Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send HTML mails using Amazon SNS?

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.

like image 985
ashishb Avatar asked Oct 05 '13 19:10

ashishb


People also ask

Does SES support HTML?

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.

Can SNS receive emails?

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.

Can SNS send email with attachment?

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.


1 Answers

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.

like image 51
xmarcos Avatar answered Oct 06 '22 19:10

xmarcos