-
Notifications
You must be signed in to change notification settings - Fork 384
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
add feature to deliver later #696
Conversation
Hi @wendy0402, thanks a lot for your work! This could default to It has 2 advantages over current approach:
What's your opinion? |
Hi @arnvald , |
I just remember, how about other user that after update the gem, they need to update their initializer also. we should make default method for them right? if true, do you think it is nice to check based on the rails version? |
yes, so the documentation for user in initializer should specify that 3 methods are available: deliver, deliver_now and deliver_later. |
If you think there is better solutions for how to check rails version, please tell me, I'll update it, thanks! |
Yes, there's an easier approach. You can use if Gem::Version.new("4.2.0") <= Gem::Version.new(Rails.version)
:deliver_now
else
:deliver
end |
else | ||
mail.deliver | ||
end | ||
mail.send("#{config.email_delivery_method}") |
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.
You can just use mail.send(config.email_delivery_method)
here
@wendy0402 sorry for late reply. I've just checked the code again, there's just one small fix and PR is ready to merge 👍 |
no problem @arnvald , I guess it is ready now |
Merged, thank you for your work! |
It is feature to use
deliver_later
method that exists since rails 4.2 for Action Mailer by using active job( the issue is raised here: #675).If the test is not good enough please tell me, thanks