fixed emailing error
This commit is contained in:
@@ -162,20 +162,23 @@ class WarehouseEShopOrderController extends TTCrud {
|
||||
|
||||
if ($isDryRun) {
|
||||
self::returnJson(['success' => true, 'message' => 'E-Mail Body wurde erstellt', 'body' => $body]);
|
||||
die();
|
||||
} else {
|
||||
$csvContent = $this->CSVExportNewOrdersMarkAcceptedAction(true, [$id]);
|
||||
|
||||
foreach (["ftth-versand@triotronik.com", "eshop-versand@xinon.at"] as $emailAddr) {
|
||||
$email = new Emailnotification();
|
||||
$email->setSubject("Bestellbestätigung Bestellung #$paddedId");
|
||||
$email->setBody($body);
|
||||
$email->setFrom(TT_OUTGOING_EMAIL_2FA, TT_OUTGOING_EMAIL_2FA);
|
||||
$email->setTo($emailAddr);
|
||||
$csvContent = $this->CSVExportNewOrdersMarkAcceptedAction(true, [$id]);
|
||||
$csvContent = utf8_decode($csvContent);
|
||||
$email->addAttachment(null, $csvContent, "Bestellung_$paddedId.csv", "text/csv", "attachment", "base64", "utf-8");
|
||||
$email->send();
|
||||
|
||||
}
|
||||
self::returnJson(['success' => true, 'message' => 'E-Mail wurde versendet']);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ Vue.component('warehouse-e-shop-order', {
|
||||
this.openSingleOrderEmailModal = !!this.singleOrderEmailModalId;
|
||||
this.singleOrderEmailModalText = null;
|
||||
if (this.singleOrderEmailModalId) {
|
||||
axios.get(`${window['TT_CONFIG']['BASE_PATH']}/WarehouseEShopOrder/singleOrderEmail?id=${this.singleOrderEmailModalId}`)
|
||||
axios.get(`${window['TT_CONFIG']['BASE_PATH']}/WarehouseEShopOrder/singleOrderEmail?id=${this.singleOrderEmailModalId}&dryRun=true`)
|
||||
.then(response => this.singleOrderEmailModalText = response.data)
|
||||
.catch(error => window.notify('error', error.response?.data?.message || 'Ein Fehler ist aufgetreten'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user