How to hook into the email sending process with events
If you write your own extensions, you can hook into the email sending process with the following events:
- fooman_emailattachments_before_send_order
- fooman_emailattachments_before_send_order_comment
- fooman_emailattachments_before_send_invoice
- fooman_emailattachments_before_send_invoice_comment
- fooman_emailattachments_before_send_shipment
- fooman_emailattachments_before_send_shipment_comment
- fooman_emailattachments_before_send_creditmemo
- fooman_emailattachments_before_send_creditmemo_comment
The dispatch call looks like this:
$this->eventManager->dispatch(
'fooman_emailattachments_before_send_order',
[
'attachment_container' => $this->attachmentContainer,
'order' => $order
]
);