check if email contact eists before sending emails
This commit is contained in:
@@ -293,6 +293,8 @@ class Order extends BaseAction implements EventSubscriberInterface
|
||||
*/
|
||||
public function sendOrderEmail(OrderEvent $event)
|
||||
{
|
||||
$contact_email = ConfigQuery::read('contact_email');
|
||||
if($contact_email) {
|
||||
$order = $event->getOrder();
|
||||
$customer = $order->getCustomer();
|
||||
|
||||
@@ -321,7 +323,7 @@ class Order extends BaseAction implements EventSubscriberInterface
|
||||
->addPart($textMessage, 'text/plain');
|
||||
|
||||
$mail = $this->getMailer()->send($instance);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user