Let's introduce the ability to define callbacks for emails (ie. subclasses of Marten::Emailing::Email). These callbacks should allow executing portions of code in the following situations:
Before an email gets delivered (before_deliver)
After an email gets delivered (after_deliver)
Before the content of an email gets rendered (before_render)
The before_deliver / after_deliver callbacks could be used to facilitate the tracking of sent emails or the generation of specific metrics while the before_render callback could be used to customize the context used to render templates.
Description
Let's introduce the ability to define callbacks for emails (ie. subclasses of
Marten::Emailing::Email
). These callbacks should allow executing portions of code in the following situations:before_deliver
)after_deliver
)before_render
)The
before_deliver
/after_deliver
callbacks could be used to facilitate the tracking of sent emails or the generation of specific metrics while thebefore_render
callback could be used to customize the context used to render templates.