Removed mails from being sent on booking import, added more optimized validation to the import process

This commit is contained in:
vishalsingh.qlo325
2024-03-14 16:45:00 +05:30
parent ecde8d0baa
commit 8d96b12962
4 changed files with 201 additions and 186 deletions

View File

@@ -709,15 +709,17 @@ abstract class PaymentModuleCore extends Module
'{id_order}' => $order->reference,
'{order_name}' => $order->getUniqReference()
);
Mail::Send(
(int)$order->id_lang,
'voucher',
sprintf(Mail::l('New voucher for your order %s', (int)$order->id_lang), $order->reference),
$params,
$this->context->customer->email,
$this->context->customer->firstname.' '.$this->context->customer->lastname,
null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop
);
if ($this->name != 'csvbooking') {
Mail::Send(
(int)$order->id_lang,
'voucher',
sprintf(Mail::l('New voucher for your order %s', (int)$order->id_lang), $order->reference),
$params,
$this->context->customer->email,
$this->context->customer->firstname.' '.$this->context->customer->lastname,
null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop
);
}
}
}
@@ -1027,7 +1029,7 @@ abstract class PaymentModuleCore extends Module
$order = new Order((int)$order->id);
// Send an e-mail to customer (one order = one email)
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id && $this->name != 'csvbooking') {
$invoice = new Address($order->id_address_invoice);
$delivery = new Address($order->id_address_delivery);
$delivery_state = $delivery->id_state ? new State($delivery->id_state) : false;