I'm using mandrill to send user specific digests and everything goes fine. The only problem is that gmail directly strips all the id's and classes: which is fine because mandrill gives you the possibility to convert those into into inline-css. That is: if it would work...
If I paste the output into mailchimps inliner it gets parsed correctly, the mail also gets send correctly,no errors are being generated by the API, but the inline-css is not being applied, which results into gmail being wrongly styled.
This is the code I use:
try{
$mandrill = new Mandrill('XXXXX-KEY-XXXXX');
$template_name = 'template_name';
$template_content = array(
array(
'name' => 'std_content00',
'content' => '<div>'.$content.'</div>'
)
);
$message = array(
'text' => '',
'subject' => 'Digest',
'from_email' => 'no-reply@thedigester.eu',
'from_name' => 'no-reply',
'to' => array(
array(
'email' => $userMail,
'name' => $userName,
'type' => 'to'
)
),
'headers' => array('Reply-To' => 'no-reply@thedigester.eu'),
'track_opens' => true,
'track_clicks' => true,
'inline_css' => true,
'merge' => false,
);
$async = false;
$result = $mandrill->messages->sendTemplate($template_name, $template_content, $message, $async);
} catch(Mandrill_Error $e) {
// Mandrill errors are thrown as exceptions
echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();
// A mandrill error occurred: Mandrill_Unknown_Subaccount - No subaccount exists with the id 'customer-123'
throw $e;
}
The code itself is fine. We'd probably need to see the actual HTML and CSS that you're using in the template. I'd recommend getting in touch with support via the Support link in your account if you want us to actually see how the contents would be processed by Mandrill's CSS inliner, since it's a bit different than the MailChimp one.