-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[WIP] Issue #4209 - Add deliver_later option in send_devise_notification #4224
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,10 @@ def devise_mailer | |
Devise.mailer | ||
end | ||
|
||
def delivery_method | ||
Devise.deliver_later_option ? :deliver_later : :deliver_now | ||
end | ||
|
||
# This is an internal method called every time Devise needs | ||
# to send a notification/mail. This can be overridden if you | ||
# need to customize the e-mail delivery logic. For instance, | ||
|
@@ -187,8 +191,9 @@ def devise_mailer | |
def send_devise_notification(notification, *args) | ||
message = devise_mailer.send(notification, self, *args) | ||
# Remove once we move to Rails 4.2+ only. | ||
|
||
if message.respond_to?(:deliver_now) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can remove this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HexterCH what do you think of this? I guess that's the only pending piece we have here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lucasmazza , but if remove this And really sorry about that I respond so lately. 😭 |
||
message.deliver_now | ||
message.send(delivery_method) | ||
else | ||
message.deliver | ||
end | ||
|
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.
We should add a new commenting section to the initializer template to document this for new apps.