added confirmation email for eshop
This commit is contained in:
@@ -127,6 +127,33 @@ class WarehouseEShopOrderController extends TTCrud {
|
||||
}
|
||||
}
|
||||
|
||||
// send confirmation email
|
||||
$subjectId = str_pad($id, 3, '0', STR_PAD_LEFT);
|
||||
|
||||
// create email body with all items (use $shoppingCart)
|
||||
$body = "Bestellung #$subjectId\n\n";
|
||||
$body .= "Lieferadresse:\n";
|
||||
$body .= $json['deliveryAddressName'] . "\n";
|
||||
$body .= $json['deliveryAddressLine'] . "\n";
|
||||
$body .= $json['deliveryAddressPLZ'] . ' ' . $json['deliveryAddressCity'] . "\n\n";
|
||||
$body .= "Bestellte Artikel:\n";
|
||||
foreach ($shoppingCart as $item) {
|
||||
$body .= $item['amount'] . ' x ' . $item['title'] . "\n";
|
||||
}
|
||||
$body .= "\n\n";
|
||||
$body .= "Bestellung wurde nun zur weitere Bearbeitung angenommen.\n";
|
||||
$body .= "XINON GmbH";
|
||||
|
||||
$user = UserModel::getOne($json['createBy']);
|
||||
|
||||
|
||||
$email = new Emailnotification();
|
||||
$email->setSubject("Bestellbestätigung Bestellung #$subjectId");
|
||||
$email->setBody($body);
|
||||
$email->setFrom(TT_OUTGOING_EMAIL_2FA, TT_OUTGOING_EMAIL_2FA);
|
||||
$email->setTo($user->email);
|
||||
$email->send();
|
||||
|
||||
self::returnJson(['success' => true,
|
||||
'message' => $this->infoMessages['create'],
|
||||
'id' => $id]);
|
||||
|
||||
Reference in New Issue
Block a user