diff --git a/application/Contract/Contract.php b/application/Contract/Contract.php index f63deb256..77d2e1d33 100644 --- a/application/Contract/Contract.php +++ b/application/Contract/Contract.php @@ -272,9 +272,15 @@ class Contract extends mfBaseModel { $email->addAttachment($pdfpath, null, $pdfname, "application/pdf"); $email->send(); - $email->setSubject("Kündigungbestätigung ".$this->owner->customer_number." ".str_replace(["\n", "\r"], "", $this->owner->getCompanyOrName())); - $email->setTo("office@xinon.at"); - $email->send(); + $oemail = new Emailnotification(); + $oemail->setSubject("Kündigungbestätigung ".$this->owner->customer_number." ".str_replace(["\n", "\r"], "", $this->owner->getCompanyOrName())); + $oemail->setBody($body); + $oemail->setFrom($from, $from_name); + $oemail->setTo("office@xinon.at"); + $oemail->setHeader("X-".MFAPPNAME."-Cid", $this->id); + $oemail->addAttachment($pdfpath, null, $pdfname, "application/pdf"); + + $oemail->send(); $this->log->info(__METHOD__.": Sending Cancel Notication for ".$this->owner_id." to $to"); } @@ -293,7 +299,7 @@ class Contract extends mfBaseModel { $tk_email->setSubject($tk_values["subject"]); $tk_email->setBody($tk_body); $tk_email->setFrom($tk_values["from_email"], $tk_values["from_email_name"]); - $tk_email->setTo($to); + $tk_email->setTo("workspace@xinon.at"); $tk_email->setHeader("X-".MFAPPNAME."-Cid", $this->id); $tk_email->send();