For our product we need to be able to schedule email messages for a recipient. Our product also wants to ensure that the recipient doesn't get spammed by too many messages. So, we are looking for an API that allows our product to schedule the messages over to the API and if the API finds more than one message scheduled for the same time, then it combines them in a reasonably intelligent manner.
Example, the product calls API with following requests:
At 2PM, [email protected] receives the following:
It seems that MailGun fits our general requirements except for this one requirement. Is there an API that solves this? If not, how do others solve it?
You could create a simple database with two tables, "recipient" (name, e-mail adresss) and "message" (date_created, body, …). The relation of recipient to message is obviously 1:n.
Then you set up a cron job, collecting all messages that are older than, let's say, 5 hours; group them by recipient, wrap the messages into a nice template and pass them to the MTA.
Btw, I personally think that it's acceptable to send several e-mails within a short period of time – given that each e-mail is meaningful and self-contained. It is very nice of you to try reducing e-mail traffic, but in most cases, people won't mind, and they'll appreciate the instant notification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With