Skip to content

Commit

Permalink
mailer: Use Namespaced Mailer
Browse files Browse the repository at this point in the history
This commit instantiates the mailer using the correct namespace.
  • Loading branch information
protich committed Nov 14, 2022
1 parent 58bf538 commit 133585f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function mb_str_wc($str) {

static function croak($message) {
$msg = $message."\n\n".THISPAGE;
Mailer::sendmail(ADMIN_EMAIL, 'osTicket Fatal Error', $msg,
osTicket\Mail\Mailer::sendmail(ADMIN_EMAIL, 'osTicket Fatal Error', $msg,
sprintf('"osTicket Alerts"<%s>', ADMIN_EMAIL));
//Display generic error to the user
Http::response(500, "<b>Fatal Error:</b> Contact system administrator.");
Expand Down
2 changes: 1 addition & 1 deletion include/class.export.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ function email(Staff $staff) {
|| !($email=$cfg->getDefaultEmail()))
return false;

$mailer = new Mailer($email);
$mailer = new osTicket\Mail\Mailer($email);
$mailer->addFileObject($file);
$subject = __("Export");
$body = __("Attached is file containing the export you asked us to send you!");
Expand Down
2 changes: 1 addition & 1 deletion include/class.filter_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ function apply(&$ticket, array $info) {

// Honor FROM address settings
if (!$config['from'] || !($mailer = Email::lookup($config['from'])))
$mailer = new Mailer();
$mailer = new osTicket\Mail\Mailer();

// Allow %{user} in the To: line
$replacer = new VariableReplacer();
Expand Down
3 changes: 2 additions & 1 deletion include/class.osticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ function alertAdmin($subject, $message, $log=false) {
if($email) {
$email->sendAlert($to, $subject, $message, null, array('text'=>true, 'reply-tag'=>false));
} else {//no luck - try the system mail.
Mailer::sendmail($to, $subject, $message, '"'.__('osTicket Alerts').sprintf('" <%s>',$to));
osTicket\Mail\Mailer::sendmail($to, $subject, $message,
'"'.__('osTicket Alerts').sprintf('" <%s>',$to));
}

//log the alert? Watch out for loops here.
Expand Down
2 changes: 1 addition & 1 deletion include/class.upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function onError($error) {
if($email) {
$email->sendAlert($thisstaff->getEmail(), $subject, $error);
} else {//no luck - try the system mail.
Mailer::sendmail($thisstaff->getEmail(), $subject, $error,
osTicket\Mail\Mailer::sendmail($thisstaff->getEmail(), $subject, $error,
'"'._S('osTicket Alerts')."\" <{$thisstaff->getEmail()}>");
}

Expand Down

0 comments on commit 133585f

Please sign in to comment.