emailSenderHandler = $emailSenderHandler; } /** * Handles asynchronous email sending during corresponding * cron job. * * Also method is used in the next events: * * - config_data_sales_email_general_async_sending_disabled * * Works only if asynchronous email sending is enabled * in global settings. * * @param \Magento\Framework\Event\Observer $observer * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function execute(\Magento\Framework\Event\Observer $observer) { $this->emailSenderHandler->sendEmails(); } }