10

Simple as that, I am using AWS SDK in Node to make a Lambda procedure that is in charge of sending emails according to data it receives.

I would like to 'delay' that email, delivering in a date and time received, not in the specific moment that the function was called. The Date and Time to deliver are parameters received by the function. Any thoughts? I couldn't find much searching on the web.

Thanks in advance!

Mark B
  • 183,023
  • 24
  • 297
  • 295
  • If you don't need to schedule more than 3 days in advance, you can use [another mail delivery service, like SparkPost or Sendgrid. Mandrill](https://webmasters.stackexchange.com/questions/128911/how-can-i-schedule-emails-to-be-sent-more-than-3-days-in-advance) *might* support longer-term scheduling, but they don't specifically document that anywhere. – Dan Dascalescu Apr 18 '20 at 01:46

2 Answers2

4

You should develop a queue for sending email because AWS SES does not offer that feature and if you want to send a lot of emails very soon, you have the problem with sending limit. So, the queue is vital in any email sender service.

For the queue, you can use AWS SQS, for handling hard and soft bounces you can use AWS SNS and AWS lambda function to manage all of them.

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
Reza Mousavi
  • 4,420
  • 5
  • 31
  • 48
-3

SES does not provide this natively. What I've done is to create a queue to process the emails plus schedule them within my limits.

Here's the psuedocode:

queue = []
limitPerSecond = <Your API limit>
putEmailsInQueue(queue)

while (true) {
  processQueue(queue)
  wait 1s
}

function processQueue(queue) {
  numberOfEmailsToPop = limitPerSecond
  emailsToSend = popEmailsFromQueue(queue, numberOfEmailsToPop)
  sendEmails(emailsToSend)
}

You can also check out huhumails.com

Disclaimer: I'm the author of the service and I made it to make it easier for people to worry less about this issue.

HuhuMails acts as the middle-man between you and Amazon SES to take care of email scheduling and make sure your emails are sent within your rate limit. It also accepts date and timezone parameters if you want to send your email in the future.

I'm currently using this for my other websites as well. Hope you and other people find it useful. Let me know if you have any questions.

Manny
  • 6,277
  • 3
  • 31
  • 45