-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from CrisHigham/master
Messenger documentation and debug changes
- Loading branch information
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ public function __construct(MessengerSettings $settings = null) | |
* | ||
* The sendMail function takes on a number of params and sends and email to a receipient. | ||
* | ||
* @param mixed $recipients array This can be a String or Array, the String should be ; delimited [email protected];[email protected] or ["name" => "Test", "email" => "[email protected]"] | ||
* @param mixed $recipients array This can be a String or Array of Arrays, the String should be ; delimited [email protected];[email protected] or [["name" => "Test", "email" => "[email protected]"],["name" => "Test Two", "email" => "[email protected]"]] | ||
* @param string $subject The subject for the email | ||
* @param mixed $message array/string The message to send to the Receipient - can be ["template" => "twigFile", "data" => Array or Object] | ||
* @param string $fromName The name of the person sending the message | ||
|
@@ -85,7 +85,6 @@ final public function sendEmail($recipients, string $subject, $message, string $ | |
file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/messenger/spool/email_" . date("d_m_Y_h_i_s") . ".eml", $headers . $message); | ||
|
||
if (!$this->settings->usePHPMailer) { | ||
Debug::message("Sending email using PHP mail"); | ||
$message = $this->prepareHtmlMail($message, $eol, "--" . $boundary_rel, "--" . $boundary_alt); | ||
|
||
if (!empty($this->settings->smtpPort)) { | ||
|
@@ -105,6 +104,7 @@ final public function sendEmail($recipients, string $subject, $message, string $ | |
|
||
die("Install PHP Mailer - <pre><code>composer require phpmailer/phpmailer</code></pre>"); | ||
} else { | ||
Debug::message("Sending email using PHP mail"); | ||
$phpMailer = new \PHPMailer\PHPMailer\PHPMailer(true); | ||
try { | ||
ob_start(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters