is it possible to send transactional

is it possible to send transactional emails in an idempotent fashion from an email worker?
7 Replies
onnimonni
onnimonni•9mo ago
Brevo is the only platform where I have seen this. I get some free emails if you sign up with this link: https://get.brevo.com/skgnkk41ehub They have idempotencyKey attribute which ensures that all emails with same unique key will not be allowed in next 15min. If 15min is not enough for you then I'm not aware of any other options.
curl --request POST \
--url https://api.sendinblue.com/v3/smtp/email \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'api-key: YOUR-API-KEY-HERE' \
--data '
{
"sender": {
"name": "Mauricio",
"email": "[email protected]"
},
"to": [
{
"email": "[email protected]",
"name": "Mauricio2"
}
],
"headers": {
"idempotencyKey": "b52dbf-81dd-4a08-b807-085c" -----> New attribute 🎉🎉🎉 !
},
"subject": "This is a unique email",
"templateId": 1
}
'
curl --request POST \
--url https://api.sendinblue.com/v3/smtp/email \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'api-key: YOUR-API-KEY-HERE' \
--data '
{
"sender": {
"name": "Mauricio",
"email": "[email protected]"
},
"to": [
{
"email": "[email protected]",
"name": "Mauricio2"
}
],
"headers": {
"idempotencyKey": "b52dbf-81dd-4a08-b807-085c" -----> New attribute 🎉🎉🎉 !
},
"subject": "This is a unique email",
"templateId": 1
}
'
Email Marketing done right
Email Marketing Done Right
onnimonni
onnimonni•9mo ago
They also have pretty nice 300 free emails per day setup
johtso
johtsoOP•9mo ago
I came across that while googling, seems promising. The fact they want to put their branding on your emails unless you pay extra put me off a bit though.. Oh wait, maybe that's just the marketing platform product? Awesome, I was looking at the wrong pricing
onnimonni
onnimonni•9mo ago
I just send a test email to myself and I didn't see any branding from them
onnimonni
onnimonni•9mo ago
I haven't used it too much yet myself. I'm just starting to build my own product. I created quickly a test template and at least here it doesn't say brevo anywhere
No description
onnimonni
onnimonni•9mo ago
And I can verify that when I tried to send another email with the same idempotency header it gave me this error message:
{"code":"duplicate_parameter","message":"Email for the idempotency key has already been processed"}
{"code":"duplicate_parameter","message":"Email for the idempotency key has already been processed"}
I haven't yet tested how much I can alter the template contents with the API though but I assume it can be done. In the earlier workplace where I was working we had a cluster of 32 background workers and we send 32 duplicate emails for thousand customers because there was a bug 😄 After that I wish we would have used brevo
johtso
johtsoOP•9mo ago
Yikes 😂
Want results from more Discord servers?
Add your server