-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Description
I think there is a need for an event to be dispatched before calling setTemplateParams
when an e-mail is sent. I often needed this to add extra information in e-mail templates (at least for 1.x version) and the only way I could do it is to rewrite the method. (or am I doing it wrong?)
Here is an example.
in Magento\Sales\Model\Order::sendNewOrderEmail()
this code
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml
)
);
can be
$params = new \Magento\Object(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml
));
$this->_eventManager->dispatch('sales_order_new_email', array('params'=>$params));
$mailer->setTemplateParams($params->getData());
Metadata
Metadata
Assignees
Labels
No labels