How to send HTML mails using Amazon SNS? or do I need to use SES for that? I went through the documentation but it seems there is no way to send HTML mails using Amazon SNS.
The Amazon SES API provides the SendEmail action, which lets you compose and send a formatted email. SendEmail requires a From: address, To: address, message subject, and message body—text, HTML, or both.
If you choose to receive your emails through Amazon SNS notifications, the maximum email size (including headers) is 150 KB. Larger emails will bounce. If you anticipate emails larger than this size, save the emails to an Amazon S3 bucket instead.
SNS' primary feature is sending notification messages, not attachments. If you need to send attachments with your email, then you'll need to use AWS' Simple Email Service (SES), along with its SendRawEmail to achieve this functionality.
You can use Amazon SES to send the emails and SNS to trigger the sending process.
Suppose you have an app http://myapp.com
where the endpoint /api/send-email
takes care of sending HTML email trough Amazon SES.
You set up an Amazon SNS topic, subscribe the endpoint /api/send-email
to receive notifications and when something happens, the notification will trigger the email.
You can setup /api/send-email
to take parameters from the JSON data stored in the notification and send the email using that information.
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