-
Notifications
You must be signed in to change notification settings - Fork 228
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
In generic_send_email
, check if mail object responds to delivery method instead of checking inheritance from ActionMailer
#211
Conversation
Instead of checking for an inheritance of ActionMailer::Base, just see if the conffigure mailer and method respond to the configured delivery method. Since both the mailer and the willingniess to automatically send out messages can be configured, the message should be send if it is sendable, regardless of which Class the configured mailer inherits from.
Not having a manifest was causing issues running `bundle exec rake` with sprockets 4.
I agree with this change.
I'm not sure what do you mean by this? P.S. build should now be fixed (5ac8d62) |
I was thinking of someone with a similar setup I described above that we are currently in. Let's say class UserMailer < SuperMailer
def activation_needed_email
mail_construction_method(
# Some mail setup
).deliver_later
end
end I'm not sure if we would be breaking something with the explicit |
Remove MySQL database creation call (Sorcery#214)
@Plsr: Thanks for additional explanation, I see now what you mean. I'd say that it would be enough simply to explain this in the change log, so users who were affected by this issue can now get rid of hacks. |
Any updates on this? We are encountering the same problem once again in another project. |
Is there anything more needed to merge this? I'm having the same issue.... |
Merging this into master, I think this would be a good opportunity to get @mladenilic to try their hands at the deployment process. Hopefully we should have a new version out in the next couple days, barring that you should be able to point at the master branch to get the change in the short term. |
What changed
generic_send_email
now checks if the createdmail
object responds to the configured delivery method and attempts to send out the message if this is true. (Was checking for inheritance fromActionMailer::Base
before)manifest.js
in the rails app in specs. Not having this would cause errors runningbundle exec rake
with sprockets 4 (happy to remove this if this is just a problem with my configuration)Why?
In one of our projects, we are using the mandrill_mailer gem to send out mails with MailChimp. mandrill_mailer does not inherit from
ActionMailer
, but implements all its delivery methods to mimic its behavior. It took us quite a while to find out why out mails were not being sent by sorcery.Since the user is required to configure a "Mailer" and pass it to sorcery and also can configure not to automatically send out messages, I would expect sorcery to send out messages if they are sendable, no matter the communication channel.
Feedback
From what I can see in the version history, this inheritance check has been there from the first commit and was just loosened up a little in 2012 (ab97a3f#diff-ae4a62ce1fc7636933767432515a82bdR187). Since the check was pretty explicit, I don't know what side effects this change might have and if I'm overlooking anything here.
Also I'm not sure if this might be a breaking change for some users, as it could trigger sending out messages twice, based on the configuration.
Looking forward to hear your thoughts on this!