-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating the email delivery method #300
Conversation
@@ -50,6 +50,20 @@ def format | |||
end | |||
params.merge(recipient: recipient, record: record) | |||
end | |||
|
|||
def args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should standardize on args
or arguments
? I usually don't like to abbreviate, but Its kind of likeparams
and parameters
?
@@ -2,4 +2,8 @@ class UserMailer < ApplicationMailer | |||
def comment_notification | |||
mail(body: "") | |||
end | |||
|
|||
def comment_notification_for(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a new mailer action that accepts an argument.
@excid3 in general what do you think about having options that just check if a method is defined rather than passing it as an option? For example, rather than passing the option
would become:
You lose the flexibility to call the method whatever you want but gain convention-over-configuration goodness. Just a thought! |
This is rolled into v2. 👍 |
This introduces a new option to the email delivery method to pass in arguments to mailers.
Sometimes a mailer will accept arguments:
This can now be accounted for with an
args
option:This will also work with a mailer that accepts named arguments with the
named_args
option: