Tips & tricks: Scheduling email delivery
It’s always fun chatting with customers about what they like about Mailgun (and what they’d like to see improved ).
It’s always fun chatting with customers about what they like about Mailgun (and what they’d like to see improved ). We spoke to a customer recently who LOVED that they could schedule delivery of their messages at a specific time in the future. Who knew that this little feature would mean so much to some customers. Today’s blog is about how it works, in case it’s not already part of your workflow.
table of content
Scheduling email delivery at a particular time
Some emails needs to be delivered as quickly as possible: error reports, password resets, and welcome emails, for example. Others, however, need to arrive at a particular time to be most effective. For instance, a local restaurant might want to send their daily lunch specials everday at 11 am, so people get it right when their stomachs are starting to growl, but before they’ve chosen a restaurant. The same email received at 4pm is a lot less useful!
Here are some other times that scheduling messages makes sense:
You want your emails delivered to recipients worldwide at a specific time in their local time zone
You want to send an upgrade offer 48 hours after a customer signups for a free trial
You’re leaving on vacation but still want your monthly release notes delivered to your users while you are relaxing on a beach
Mailgun makes this easy with the o:deliverytime parameter which is available when you send email through our API or SMTP.
Sample code to schedule message delivery
o:deliverytime is simply a parameter that you specify when sending Mailgun your message. It is set just like to:, from: , subject: and all the other parameters of your email.
Here is what the code could look like to send a single email:
If you want to send different recipients the same email at different times (say at 9am on the East and West Coast), you can using Batch Sending to send up to 1000 recipients in a single API call. Just define the delivery time for each batch when you send it as above. And remember that with Batch Sending, you can use Recipient Variables to personalize each email in the batch with things like First Name, Order Amount, even targeted offers. You can read more about adding Recipient Variables to your emails here.
'Thu, 13 Oct 2011 18:02:00 GMT'
Finally, there are a lot of factors that affect delivery time including the email content itself which influences how likely ESPs like Gmail and Yahoo are to flag it as spam and delay or prevent delivery. Mailgun will make every effort to deliver your emails as close to your specified time as possible, but can’t guarantee delivery at a specific time. In addition to using o:deliverytime, following our Email Best Practices guide is the best way to make sure your emails get delivered in a timely manner.
Happy emailing, The Mailgunners