martenframework / marten

The pragmatic web framework.
https://martenframework.com
MIT License
405 stars 23 forks source link

Add email callbacks #141

Closed ellmetha closed 8 months ago

ellmetha commented 8 months ago

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:

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.