]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Empty but required-not-empty variables needs now bugfixing
[mailer.git] / inc / functions.php
index 2b9f431af1fe8e86e5855d351e0c40e1859c97fc..d8f842c1f4194d7954f5cddc520fe3e7b1b0f87b 100644 (file)
@@ -85,11 +85,16 @@ function getTotalFatalErrors () {
 // Send mail out to an email address
 function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '') {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'toEmail=' . $toEmail . ',subject=' . $subject . ',isHtml=' . $isHtml);
+       // Empty parameters should be avoided, so we need to find them
+       if (empty($isHtml)) {
+               // isHtml is empty
+               debug_report_bug(__FUNCTION__, __LINE__, 'isHtml is empty.');
+       } // END - if
 
        // Set from header
        if ((!isInStringIgnoreCase('@', $toEmail)) && ($toEmail > 0)) {
                // Does the user exist?
-               if (fetchUserData($toEmail)) {
+               if ((isExtensionActive('user')) && (fetchUserData($toEmail))) {
                        // Get the email
                        $toEmail = getUserData('email');
                } else {
@@ -123,11 +128,6 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
                }
        } // END - if
 
-       // Fix HTML parameter (default is no!)
-       if (empty($isHtml)) {
-               $isHtml = 'N';
-       } // END - if
-
        // Debug mode enabled?
        if (isDebugModeEnabled()) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part