If, like me, you’ve wondered why the Action Mailer Basics guide (https://guides.rubyonrails.org/action_mailer_basics.html#calling-the-mailer) uses .with()
and params
instead of passing arguments to the method on the mailer (i.e. UserMailer.with(user: alice).welcome_email
vs UserMailer.welcome_email(user: alice)
), this API and its rationale is documented under Action Mailer Parameterized: https://api.rubyonrails.org/v7.1.3.4/classes/ActionMailer/Parameterized.html
(I actually prefer the non-parameterised version but it helps to understand the API is meant for extracting common setup.)
=> More informations about this toot | View the thread | More toots from mudge@ruby.social
text/gemini
This content has been proxied by September (ba2dc).