Skip to content

Commit

Permalink
never queue debug mails
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Aug 21, 2024
1 parent c94edca commit 9f15e7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Log/Engine/FileAndEmailLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Cake\Network\Exception\SocketException;
use Cake\Routing\Router;
use Cake\Utility\Text;
use App\Mailer\AppMailer;

class FileAndEmailLog extends FileLog
{
Expand Down Expand Up @@ -47,15 +46,15 @@ private function sendEmailWithErrorInformation($message)
$preparedHostWithoutProtocol = str_replace('www.', '', $preparedHostWithoutProtocol);
$subject = 'ErrorLog ' . $preparedHostWithoutProtocol . ': ' . Text::truncate($message, 150) . ' ' . date('Y-m-d H:i:s');
try {
$email = new AppMailer();
$email = new Mailer();
$email->viewBuilder()->setTemplate('debug');
$email->setTo(Configure::read('AppConfig.debugMailAddress'))
->setSubject($subject)
->setViewVars(array(
'message' => $message,
'identity' => $identity,
))
->addToQueue();
->send();
} catch (SocketException $e) {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/Mailer/AppMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
namespace App\Mailer;

use Cake\Mailer\Mailer;
use Cake\Core\Configure;
use Cake\Datasource\FactoryLocator;
use App\Services\OutputFilter\OutputFilterService;
use Cake\Mailer\Message;

class AppMailer extends Mailer
Expand Down

0 comments on commit 9f15e7b

Please sign in to comment.