Sending email to ticketsystem after Contract Cancel
This commit is contained in:
@@ -17,7 +17,7 @@ $this->setReturnValue([
|
||||
body {
|
||||
margin-left: 36pt;
|
||||
margin-right: 36pt;
|
||||
font-size: 11pt;
|
||||
font-size: 10pt;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -49,10 +49,10 @@ $this->setReturnValue([
|
||||
<div style="height:56pt;"></div>
|
||||
|
||||
<div>
|
||||
<div style="float: right">
|
||||
<div style="width: 50%; text-align: right; float: right">
|
||||
<div style="margin-right: 0">Studenzen, <?=date("d.m.Y")?></div>
|
||||
</div>
|
||||
<div style="width: 50%">
|
||||
<div>
|
||||
<h3>Kündigungsbetätigung</h3>
|
||||
</div>
|
||||
|
||||
@@ -97,15 +97,15 @@ $this->setReturnValue([
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<div>
|
||||
<p>Die gekündigten Produkte und Services stehen Ihnen nach dem Kündigungsdatum nicht mehr zur Verfügung</p>
|
||||
<p>Die gekündigten Produkte und Services stehen Ihnen nach dem Kündigungsdatum nicht mehr zur Verfügung.</p>
|
||||
<p>Sollten Sie keine Produkte oder Services mehr von uns beziehen, werden Ihre in unserem System gespeicherten Daten
|
||||
gemäß den gesetzlichen Vorgaben nach Ablauf der vorgeschriebenen Fristen gelöscht.</p>
|
||||
<p>Die Abrechnung der Entgelte für die genutzten Services erfolgt bis zum genannten Datum und wird Ihnen entsprechend übermittelt.</p>
|
||||
<p>Wir bedanken uns für Ihr Vertrauen und wünschen Ihnen alles Gute für die Zukunft.</p>
|
||||
</div>
|
||||
<div style="height:1.2pt;"></div>
|
||||
<p>Mit freundlichen Grüßen,</p>
|
||||
<p>Xinon GmbH</p>
|
||||
<p>Mit freundlichen Grüßen,<br /></p>
|
||||
Xinon GmbH</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
39
Layout/default/Emailtemplates/customer/cancel_ticket.php
Normal file
39
Layout/default/Emailtemplates/customer/cancel_ticket.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
$this->setReturnValue([
|
||||
'subject' => "Kündigung zum "
|
||||
.date("d.m.Y", $contract->cancel_date)
|
||||
." - "
|
||||
.$owner->customer_number
|
||||
." "
|
||||
.str_replace(["\n", "\r"], "", $owner->getCompanyOrName()),
|
||||
'from_email' => "workspace.admin@xinon.at",
|
||||
'from_email_name' => "thetool"
|
||||
]);
|
||||
|
||||
$url_prefix = "http".($_SERVER["HTTPS"] ? "s" : "")."://".$_SERVER["HTTP_HOST"];
|
||||
?>
|
||||
project: storungen-and-support
|
||||
type: Kundigung
|
||||
status: Neu
|
||||
priority: Residential
|
||||
Kundenname: <?=str_replace(["\n", "\r"], "", $owner->getCompanyOrName())?>
|
||||
|
||||
Telefon: <?=$owner->phone?>
|
||||
|
||||
e-Mail: <?=$owner->email?>
|
||||
|
||||
Kundennummer: <?=$owner->customer_number?>
|
||||
|
||||
|
||||
### Gekündigte Produkte:
|
||||
|
||||
Kunde: [<?=$url_prefix?><?=self::getUrl("Address", "view", ["id" => $owner->id])?>](<?=str_replace(["\n", "\r"], "", $owner->getCompanyOrName())?>)
|
||||
|
||||
| Produkt | Matchcode | Kündigungsdatum |
|
||||
------------------------------------------
|
||||
[<?=($url_prefix)?><?=self::getUrl("Contract", "view", ["contract_id" => $contract->id])?>](<?=$contract->product_name?>) | <?=$contract->matchcode?> | <?=date("d.m.Y", $contract->cancel_date)?> |
|
||||
|
||||
<?php foreach($linked_contracts as $link): ?>
|
||||
[<?=$url_prefix?><?=self::getUrl("Contract", "view", ["contract_id" => $link->id])?>](<?=$link->product_name?>) | <?=$link->matchcode?> | <?=date("d.m.Y", $link->cancel_date)?> |
|
||||
|
||||
<?php endforeach; ?>
|
||||
@@ -238,8 +238,8 @@ class Contract extends mfBaseModel {
|
||||
"owner" => $this->getProperty("owner")
|
||||
];
|
||||
$pdf = new PdfForm("Emailtemplates/attachments/cancel_notification.pdf", $pdf_vars);
|
||||
$pdf->download();
|
||||
exit;
|
||||
//$pdf->download();
|
||||
//exit;
|
||||
$pdfpath = $pdf->render();
|
||||
$tvalue = $pdf->getReturnedValues();
|
||||
$pdfname = $tvalue["filename"];
|
||||
@@ -272,11 +272,31 @@ 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();
|
||||
|
||||
$this->log->info(__METHOD__.": Sending Cancel Notication for ".$this->owner_id." to $to");
|
||||
}
|
||||
|
||||
$tk_tpl = new Layout();
|
||||
$tk_tpl->setTemplate("Emailtemplates/customer/cancel_ticket");
|
||||
|
||||
foreach($pdf_vars as $name => $val) {
|
||||
$tk_tpl->set($name, $val);
|
||||
}
|
||||
|
||||
$tk_body = $tk_tpl->render();
|
||||
$tk_values = $tk_tpl->getReturnedValue();
|
||||
|
||||
$tk_email = new Emailnotification();
|
||||
$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->setHeader("X-".MFAPPNAME."-Cid", $this->id);
|
||||
$tk_email->send();
|
||||
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
|
||||
Reference in New Issue
Block a user