Mandrill sending a null sender field.

199 views
Skip to first unread message

Jordon Bedwell

unread,
Oct 18, 2012, 10:33:06 AM10/18/12
to mandrill-a...@googlegroups.com
I was wondering if anyone can explain why Mandrill would be sending null for sender field of a message when parsing incomming messages.  For example while testing Mandrill incoming via Pry this is what I came up with:

  begin
     mandrill = JSON.parse(params["mandrill_events"])).map(&:deep_symbolize_keys!)
     binding.pry
     # [25] pry(#<SubscriberController>)> mandrill.first[:msg][:text] => "Test\n"
     # [26] pry(#<SubscriberController>)> mandrill.first[:msg][:sender] => nil
     # [27] pry(#<SubscriberController>)> mandrill.first["msg"]["headers"]["From"].match(/<(.+)>\Z/)[1] => "m...@domain.com"
  rescue
    render :json => { status: "Fuck this, I'm out." }, status: 503
  end
end

As you can see from line 26 of the session, you guys don't send me a sender so I have to parse it myself, is there any reason why you do not send a proper sender?

Kaitlin

unread,
Oct 18, 2012, 12:32:35 PM10/18/12
to mandrill-a...@googlegroups.com
Hey Jordan,

For inbound emails, tags and sender are included to match other webhooks, but inbound messages generally won't have tags since they're being received instead of sent, and the sender is null since the event is for a message not being sent by Mandrill.  Inbound include separate parameters for sender information, specifically keys for from_name and from_email.  Here's an overview of the inbound webhook format: http://help.mandrill.com/entries/22092308-what-is-the-format-of-inbound-email-webhooks
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages