Custom plugin to override (or extend) core Email functionality

Hi there! I want to extend the core email functionality in my custom plugin, so I need to override the \Mautic\EmailBundle\Model\EmailModel model with some additions. Creating a new model and injecting the parent one is no way for me, because i need change the default way email sending.

I want to use another api key for some emails. It will be the same email service, but just two or three accounts to use in different campaigns. So I tried to override the existing model, according to the Symfony docs but it was unsuccessful. But even if it was success, i would like not changing the core files and do everything in the plugin only.

So the question: is it possible? And if yes, how can i do this?

I would try with:

See here where compiler pass is used in mautic plugin: mautic-extended-field/OverrideCompanyModelPass.php at 53e9c495282d6561c44f5b852d643417cfc82f3f · TheDMSGroup/mautic-extended-field · GitHub

Thanks! That’s exactly what I need

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.