Skip to content

Commit

Permalink
Merge pull request #82 from CrisHigham/master
Browse files Browse the repository at this point in the history
Messenger documentation and debug changes
  • Loading branch information
tina4stack authored Sep 11, 2023
2 parents b9c492f + 845c651 commit 3b07896
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Tina4/Messaging/Messenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Tina4/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ final public function resolveRoute(?string $method, ?string $url, ?Config $confi

//SECOND STATIC FILES - ONLY GET
if ($method === TINA4_GET) {
$fileName = realpath(TINA4_DOCUMENT_ROOT . PATH_SEPARATOR."src".PATH_SEPARATOR."public".$url); //The most obvious request
$fileName = realpath(TINA4_DOCUMENT_ROOT . DIRECTORY_SEPARATOR . "src" . DIRECTORY_SEPARATOR . "public" . $url); //The most obvious request
if (file_exists($fileName) && $routerResponse = $this->returnStatic($fileName)) {
Debug::message("$this->GUID GET - " . $fileName, TINA4_LOG_DEBUG);
if (defined("TINA4_CACHED_ROUTES") && strpos(print_r(TINA4_CACHED_ROUTES, 1), $url) !== false) {
Expand Down

0 comments on commit 3b07896

Please sign in to comment.