Mailers in Phoenix 1.3 - in /web directory or not?

You’re missing, that phoenix view do not need to be dependent on what’s in your web folder. The ones which are there are totally web related, but you can create your own view templates / view modules based on phoenix.views, which live in your mailer context totally separate to your web views.

I’ve created a sample github repo for it (also for my own don’t-create-it-from-scratch-ever-again storage):
https://github.com/LostKobrakai/phoenix-mailer-context/commit/6872acb17df217d1684c084c4d8699d1f697db80
(Please ignore the formatting issues)

Edit:
One could even move the gettext module in the mailer context as well, but I’m not sure about that. Having the RouteHelpers depend on the web context is fine in my mind, because without web context there are no routes and therefore no RouteHelpers :slight_smile:

6 Likes