There must always be one PHPMailer instance per email (fixes #192).
This commit is contained in:
parent
8332eecee2
commit
9b6bdc1bd6
1 changed files with 12 additions and 10 deletions
|
@ -135,7 +135,7 @@ class Email {
|
||||||
|
|
||||||
if (!$mailer->Send()) {
|
if (!$mailer->Send()) {
|
||||||
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||||
. $this->mailer->ErrorInfo);
|
. $mailer->ErrorInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,16 +193,18 @@ class Email {
|
||||||
$html = file_get_contents(__DIR__ . '/../../application/views/emails/delete_appointment.php');
|
$html = file_get_contents(__DIR__ . '/../../application/views/emails/delete_appointment.php');
|
||||||
$html = $this->_replaceTemplateVariables($replaceArray, $html);
|
$html = $this->_replaceTemplateVariables($replaceArray, $html);
|
||||||
|
|
||||||
// Send email to recipient.
|
$mailer = $this->_createMailer();
|
||||||
$this->mailer->From = $company['company_email'];
|
|
||||||
$this->mailer->FromName = $company['company_name'];
|
|
||||||
$this->mailer->AddAddress($recipientEmail->get()); // "Name" argument crushes the phpmailer class.
|
|
||||||
$this->mailer->Subject = $this->framework->lang->line('appointment_cancelled_title');
|
|
||||||
$this->mailer->Body = $html;
|
|
||||||
|
|
||||||
if (!$this->mailer->Send()) {
|
// Send email to recipient.
|
||||||
|
$mailer->From = $company['company_email'];
|
||||||
|
$mailer->FromName = $company['company_name'];
|
||||||
|
$mailer->AddAddress($recipientEmail->get()); // "Name" argument crushes the phpmailer class.
|
||||||
|
$mailer->Subject = $this->framework->lang->line('appointment_cancelled_title');
|
||||||
|
$mailer->Body = $html;
|
||||||
|
|
||||||
|
if (!$mailer->Send()) {
|
||||||
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||||
. $this->mailer->ErrorInfo);
|
. $mailer->ErrorInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +238,7 @@ class Email {
|
||||||
|
|
||||||
if (!$mailer->Send()) {
|
if (!$mailer->Send()) {
|
||||||
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||||
. $this->mailer->ErrorInfo);
|
. $mailer->ErrorInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue