mailchimp/mailchimp-gem — pull request #27 by tcoulter (2013-05-09 01:51:12+00:00)
Title: Fix issue #26: Garbage headers when sending email with both text and html parts

Problem: When using the Mandrill delivery with ActionMailer to send a multipart message (i.e., text and html), header data will be sent to Mandrill for each part instead of just the part's body. This is because Rails sets the mime type of the message to `multipart/alternative`, which isn't taken into account in the `get_content_for` method.

Solution: Specifically check for `multipart/alternative`, and if it is found, return the part's body rather than the full message body for each part. (In fact, `get_content_for` was returning the part object in this case, which was evaluated with `to_s` somewhere down the execution path causing extra headers to be injected.

This fixes issue #26.