Today I Learned
I built a Rails mailer for the first time in a very long time today. Revisiting the docs, I was greeted with a signature I didn’t recall from the past.
Mailer.with(some: "params", set: "this way").email_name.deliver_later
In the past, I’d always invoked mailers with
Mailer.email_name(some: "params", set: "this way").deliver_later
with message feels very aligned with
For things that are needed on all mailers, like the recipient, I like standardizing on this approach for communicating params into the mailer.