THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Hi all,
with my module I was trying to attach a csv (or other structured data file) to the notification mail.
In the actual version of MailerFactory I didn't found a function with that kind of parameter.

Looking forward (to the next thelia update) the best way to follow is add a function to MailerFactory or rewrite the entire message into my listener where I've already stop the standard event propagation (ORDER_SEND_NOTIFICATION_EMAIL)?

Thank for your advise.

Meo

Last edited by meo (29-12-2017 12:01:29)

Offline


Instead of using sendEmailToShopManagers, you can use MailerFactory::createEmailMessage() to get a Swift_Message object, and use Swift_Message::attach() to attach your file to the message.


OpenStudio Toulouse

Offline


Right, so simple! thanks.. now the trivia will be Json-serialize myobject and attach to the message.