Comments (8)
Hi koriner, the api request hash gets built up with various parameters here: https://github.com/renz45/mandrill_mailer/blob/master/lib/mandrill_mailer/template_mailer.rb
It looks like it doesn't take subaccount into consideration. If you wanted to add it and make a quick pull request I can release a new gem.
from mandrill_mailer.
Thanks @renz45 - just looking in there, it appears it is being added to the message hash (line 283). Does it need to use the subaccount field somewhere else as well?
from mandrill_mailer.
Ahhh you're right, I totally glanced right over it. Nope, that should be working. This gem is really just an extremely thin api wrapper that makes sending mandril template emails similar to a normal Rails mailer, along with the ability to send test emails.
It's odd you're not at least getting an error. According to: https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template if the subaccount was incorrect the call would fail.
Does correct content get received at the destination email? If not then maybe it's something wrong with the template. hmm
from mandrill_mailer.
Yep the email is being delivered properly with the correct content, template etc. It's odd, it's just not applying the subaccount, but no errors are happening as far as I can tell.
It's definitely possible that it's something wrong with my Mandrill setup or something. I might take it up with mandrill support. It also looks like I can apply rules on the mandrill end to assign a subaccount based on other fields so that's always an option too. Thanks for checking this out anyway, I'll post back if I figure it out.
from mandrill_mailer.
Ah, I spoke too soon. Found the API logs in Mandrill and some of the parameters aren't getting passed through. The log says the subaccount and tags fields are null for my request. Maybe I'm not passing these correctly?
Here's my mailer method
def testmail(data)
recipients = [
{ email: '[email protected]', name: 'name here'}
]
mandrill_mail template: 'test-message',
subject: "Test Message",
to: recipients,
vars: {
'MESSAGE_ID' => data[:message_id],
'SENDER_ID' => data[:sender_id],
'CONTENT' => data[:content]
},
subaccount: "my-subaccount",
inline_css: true,
tags: ["test:message"]
end
Does that look ok?
from mandrill_mailer.
Ok after shuffling things around and restarting the server it all seems to be working fine now :/
Not sure what was wrong before - but all good now!
from mandrill_mailer.
Good! I was going to say that it all looks fine. :) I'm glad you figured it out.
from mandrill_mailer.
Thanks for your help anyway :)
from mandrill_mailer.
Related Issues (20)
- Template defaults overridden HOT 6
- Suggestion: Interceptor should accept return from proc HOT 2
- assets precompile error HOT 11
- Interceptor Proc params string symbol discrepancy HOT 1
- Delay throwing warning in test_setup_for blocks if email option is missing HOT 4
- vars do not serialize properly when using deliver_later HOT 2
- Amazon SES HOT 3
- problem with template_content key in mandrill_mail(args) HOT 3
- dependent on json-1.8.3? HOT 4
- Optionally not encode attachments and images HOT 1
- Call render_to_string from MandrillMailer::TemplateMailer HOT 1
- Rails 5 support HOT 3
- Attachment not included in mail, yet no errors raised HOT 2
- Not working with rails 5 HOT 5
- Sending through array day as merge_vars HOT 1
- Optionally use 'mandrill_mailer/offline'
- Empty emails HOT 1
- Version 1.8.0 not available on RubyGems HOT 2
- Reject Error
- Unsigned error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mandrill_mailer.