Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
NotifySender.php
Go to the documentation of this file.
1 <?php
8 
10 
16 abstract class NotifySender extends Sender
17 {
25  protected function checkAndSend(Order $order, $notify = true)
26  {
27  $this->identityContainer->setStore($order->getStore());
28  if (!$this->identityContainer->isEnabled()) {
29  return false;
30  }
31  $this->prepareTemplate($order);
32 
34  $sender = $this->getSender();
35 
36  if ($notify) {
37  $sender->send();
38  } else {
39  // Email copies are sent as separated emails if their copy method
40  // is 'copy' or a customer should not be notified
41  $sender->sendCopyTo();
42  }
43 
44  return true;
45  }
46 }
$order
Definition: order.php:55