]> git.mxchange.org Git - mailer.git/blobdiff - inc/email-functions.php
Swapped all
[mailer.git] / inc / email-functions.php
index 4a2fc72ba32ef0cdf93c56bed613a99d02a83fce..a793b45e7859eaa437e887fc9269292b85fade2a 100644 (file)
@@ -81,14 +81,18 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
        } // 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
-               outputHtml('<pre>
-<strong>Headers</strong> : ' . htmlentities(trim($mailHeader)) . '
-<strong>To</strong>      : ' . htmlentities($toEmail) . '
-<strong>Subject</strong> : ' . htmlentities($subject) . '
-<strong>Message(' . strlen($message) . ')</strong> : ' . htmlentities($message) . '
-</pre>');
+       if ((isDebugModeEnabled()) && (!isAjaxOutputMode())) {
+               // Init content array
+               $content = array(
+                       'headers' => htmlentities(trim($mailHeader)),
+                       'to'      => htmlentities($toEmail),
+                       'subject' => htmlentities($subject),
+                       'message' => htmlentities($message),
+                       'length'  => strlen($message)
+               );
+
+               // In debug mode display the mail instead of sending it away so it can be debugged
+               loadTemplate('display_email', FALSE, $content);
 
                // This is always fine
                return TRUE;
@@ -223,7 +227,7 @@ function sendGenericBuildMails ($mode, $tableName, $content, $id, $subjectPart =
        } // END - if
 
        // Is the raw userid set?
-       if (isValidUserId(postRequestElement($userIdColumn[0], $id))) {
+       if (isValidId(postRequestElement($userIdColumn[0], $id))) {
                // Set it in content
                $content[$userIdColumn[0]] = bigintval(postRequestElement($userIdColumn[0], $id));