protected function sendOnNewSaleNotificationEmail(Pap_Contexts_Action $context) { if (!$this->isSendingMailNotificationEnabled($context)) { $context->debug('Sending Sale summary mail not enabled. STOPPED'); return; } $mail = new Pap_Mail_SplitCommissionsMerchantOnSale($context->getTransaction()->getSaleId()); $mail->addRecipient(Pap_Common_User::getMerchantEmail()); try { $mail->send(); } catch (Gpf_Exception $e) { $context->debug('Sending Sale summary mail failed, possibly there was no transaction recorded during sale processing. STOPPED'); return; } $context->debug('Sending Sale summary mail sended. Ended'); }