Enable pdf and email sending in Order/save

This commit is contained in:
Frank Schubert
2021-08-27 00:11:32 +02:00
parent ef38faa949
commit bdd4e76eaa
5 changed files with 111 additions and 57 deletions

View File

@@ -33,7 +33,7 @@ class Emailnotification {
];
$attachment["isfile"] = false;
if($filename) {
if($file) {
$attachment['isfile'] = true;
}
@@ -95,7 +95,7 @@ class Emailnotification {
$mime = new Mail_mime();
$mime->setTXTBody($this->body);
var_dump($att);exit;
//var_dump($this->attachments);exit;
if(count($this->attachments)) {
foreach($this->attachments as $att) {

View File

@@ -381,11 +381,13 @@ class OrderController extends mfBaseController {
if($spin && !AddressModel::search(['spin' => $spin])) {
$owner->spin = $spin;
if($owner->save()) {
/*
// render service pin PDF
$pdf = new Layout();
$pdf->setTemplate("Emailtemplates/attachments/new_order.pdf");
$pdf->set("ressourcePathPrefix", BASEDIR."/public/");
$pdf->set("owner", $owner);
$pdf->set("order", $order);
$pdfpath = $pdf->renderPDF();
$tvalue = $pdf->getReturnedValue();
@@ -421,7 +423,7 @@ class OrderController extends mfBaseController {
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
$email->send();
}
*/
}
}