thoughtbot/griddler — pull request #115 by wingrunr21 (2014-02-28 21:58:26+00:00)
Title: Fix Mandrill CC extraction and protect against missing text/html email parts

Hey,

First commit deals with CC extraction. Mandrill CC extraction is always returning an empty array. Their [docs](http://help.mandrill.com/entries/22092308-What-is-the-format-of-inbound-email-webhooks-) say that the incoming headers attribute in the JSON should be an array, but my tests showed this is actually an object (this was [alluded to](https://github.com/thoughtbot/griddler/pull/108#issuecomment-32106160) in the comments of #108). Touching base with support shows that their docs are wrong. They implement them internally as an array of arrays in PHP, but when JSON encoded it becomes an object with arrays.

Second commit is just an update to #112. Mandrill won't send a `:text` entry in the `msg` hash if the original email didn't have one or your Mandrill settings aren't set to add a text part to an HTML-only email. I went ahead and protected the `:html` attribute as well since I figured the opposite direction could happen as well.

Thanks!