Hanami 2: mailer or mail gem

Doing stuff with emails has always been a peculiar kind of fun and as splitting the email atom demonstrates, even more so when using emails for auth.

Being restrictive and always up-to-date on versions therefore are key, but looking at hanami/mailer, a bit of dust has settled on it, the dependency on mail is nailed to ~2.7.

I guess, hanami/mailer will eventually join the Hanami 2 set of gems, however, I’m wondering whether this will rather be an evolution or a rewrite (from an API point of view). Or in other words… What’s probably the better approach when only sending simple, transactional mails on Hanami 2 today: Just rely on the mail gem directly or use hanami/mailer to be ready for it’s version 2?

Cheers! -sven

hanami/mailer works with Hanami 2, at least the master version. You can use it. It’s quite thin wrapper over mail gem and I suspect you would end up with more or less the same with writing your own support for mail. At least that’s my (quite limited) experience with it.

1 Like

Ah it brings back memory. The hanami/mailer is basically just a thin wrapper around mail. I highly recommend you start with hanami/mailer simply because it
would integrate a bit better to the hanami convention. If you happen to find any particular pattern or feature that mailer lacks, feel free to bring up the
discussion here.

2 Likes

For anyone who needs this, I have recorded an episode how to integrate hanami-mailer in hanami apps (quite early versions of hanami 2)

I haven’t revisited it for a while but the idea of how to use it remains the same.

Hope this will be helpful to you!

1 Like