Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laramit's avatar

Mandrill Message ID

Does anyone know if it's possible to retrieve the Mandrill message ID when sending email using Laravel's Mail::queue?

I have a working system that sends mail through Mandrill and receives webhooks back from Mandrill but I'd like to know which message each webhook event relates to. At the moment I've added a unique header tag to each message so I can identify which message the webhook events relate to but ideally I'd just like to be able to store the Mandrill message ID when the messages are processed by the Laravel queue.

I'm not sure if this is possible though using the standard Laravel mail driver for Mandrill?

Thanks.

0 likes
2 replies
laramit's avatar

Thanks, had just been reading that link myself!

Seems that I can get the message ID that way if I use Mail::send but as I'm sending large numbers of messages and scheduling them too I need to queue them and Mail::queue doesn't return the response that Maill:send would.

Just experimenting now using Mandrill's own PHP SDK and that looks like it will do the job. I'd have to abandon Laravel's Mail and create a queueable job that will send directly to Mandrill's API so it's a little more work but looks promising so far. Or I could always create a queueable job and use Mail::send within that to achieve the same result.

Please or to participate in this conversation.