Reputation: 832
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!
Upvotes: 12
Views: 7341
Reputation: 4602
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.
Upvotes: 5
Reputation: 6287
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.
Upvotes: -2