Added Email Logging for Emailnotification class
This commit is contained in:
@@ -467,7 +467,7 @@ class Contract extends mfBaseModel {
|
||||
if(!$subject || !$from || !$from_name || !$to) {
|
||||
$this->log->warn("Service PIN Email not sent. (subject: '$subject', from: '$from_name', from_email: '$from', to: '$to')");
|
||||
} else {
|
||||
$email = new Emailnotification();
|
||||
$email = new Emailnotification("Contract", $this->id, json_encode(["type" => "cancel_notification"]));
|
||||
$email->setSubject($subject);
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
@@ -476,7 +476,7 @@ class Contract extends mfBaseModel {
|
||||
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
|
||||
$email->send();
|
||||
|
||||
$oemail = new Emailnotification();
|
||||
$oemail = new Emailnotification("Contract", $this->id, json_encode(["type" => "cancel_notification_int"]));
|
||||
$oemail->setSubject("Kündigungbestätigung " . $this->owner->customer_number . " " . str_replace(["\n", "\r"], "", $this->owner->getCompanyOrName()));
|
||||
$oemail->setBody($body);
|
||||
$oemail->setFrom($from, $from_name);
|
||||
@@ -499,7 +499,7 @@ class Contract extends mfBaseModel {
|
||||
$tk_body = $tk_tpl->render();
|
||||
$tk_values = $tk_tpl->getReturnedValue();
|
||||
|
||||
$tk_email = new Emailnotification();
|
||||
$tk_email = new Emailnotification("Contract", $this->id);
|
||||
$tk_email->setSubject($tk_values["subject"]);
|
||||
$tk_email->setBody($tk_body);
|
||||
$tk_email->setFrom($tk_values["from_email"], $tk_values["from_email_name"]);
|
||||
@@ -525,7 +525,7 @@ class Contract extends mfBaseModel {
|
||||
$tk_body = $tk_tpl->render();
|
||||
$tk_values = $tk_tpl->getReturnedValue();
|
||||
|
||||
$tk_email = new Emailnotification();
|
||||
$tk_email = new Emailnotification("Contract", $this->id);
|
||||
$tk_email->setSubject($tk_values["subject"]);
|
||||
$tk_email->setBody($tk_body);
|
||||
$tk_email->setFrom($tk_values["from_email"], $tk_values["from_email_name"]);
|
||||
|
||||
Reference in New Issue
Block a user