php - Mandrill - How do I retrieve the message content html that was just sent? -


i'm using mandrill api php.

i sending mail message:

$result = $mandrill->messages->sendtemplate($template_name, $template_content, $message); $mandrill_return_data = current($result); 

since message content saved 24 hours, retrieve html sent , save db.

$message_content = $mandrill->messages->content($mandrill_return_data['_id'])['html']; 

unfortunately, doesn't work , returns following error:

a mandrill error occurred: mandrill_unknown_message - no message exists id '446740d7b61e4403b11379db4e1d45b0'

i did googling , found this answer , explains takes few minutes index message in system , noticed case. trying figure out solution on how retrieve message content html , save db.

i suppose use cron job run every few hours or after sends message, or run ajax command retrieve message content html after specified timeout, both of solutions seem hacky. i'm hoping more elegant solution doesn't require whole lot of additional code. ideas?


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -