-
Notifications
You must be signed in to change notification settings - Fork 84
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
Template defaults overridden #117
Comments
I'm guessing it has something to do with this: https://github.com/renz45/mandrill_mailer/blob/master/lib/mandrill_mailer/arg_formatter.rb#L72 Looks like we send the entire message object, likely with a bunch of nil values, I wonder if that overwrites default values set in the mandrill gui? |
If you don't mind, could you try something really quick and see if it fixes the issue? I no longer have a mandrill account. If it does I can make the changes in the gem quick. Where ever you are calling new_message = {}
RewardSurveyTokenInvitationMailer.message.each_pair do |k,v|
if v
new_message[k] = v
end
end
RewardSurveyTokenInvitationMailer.message = new_message I think this should remove all the nil values and their keys. If this works I'll change that arg formatter method to do the same. Thanks again! |
Thanks for investigating. I’m traveling this weekend, but I’ll try your fix On Fri, Apr 22, 2016 at 9:31 AM, Adam Rensel [email protected]
|
Haven't forgotten about this. Working on our Mandrill integration this week and will test this once we're properly configured again. |
The template defaults in Mandrill for |
Just curious, did anyone try my above fix? If that works I can change the formatter to do that internally, which should fix the issue. If someone comes up with another, more preferable fix feel free to make a PR and I'll merge it in. I don't work with mandrill at all anymore, so testing api level things is a bit time consuming for me at the moment. |
I have some template defaults defined in Mandrill for a template. In my mailer I set
default view_content_link: true
but that seemed to override the template defaults for thefrom
andfrom_name
and the email was sent from "[email protected]". Interestingly, the default subject was not overwritten even though I didn't specify one in my mailer. I would expect that setting one default would not override the others that weren't specified.Removing the
default
restored the default template valuesThe text was updated successfully, but these errors were encountered: