Customizing Amazon SNS email notifications

Viewed 16479

We are developing Custom Commenting System in which email notifications will be sent to all the subscribers to the post just like "Disqus". We found AWS provides Simple Notification System(SNS) which does a fairly good job of sending mass email notifications and manages subscribers and topics, but I did not found any article on which the format of email notifications can be changed as all the emails have Amazon Branding.

Is it possible to send through Amazon SNS?

  1. Custom Email without Amazon Branding?
  2. Custom Subscription Link?
  3. Custom Un-subscribe link?
  4. Custom From Email Address?
  5. Attaching Companies logo in the email.

Thus removing Custom Amazon SNS branding.

3 Answers

You can't change the sender (AWS Notifications), but you can change the body with Lambda or custom code running on your EC2 or on-premise instances. Here's Python code for sending a custom SNS message:

import boto3
def lambda_handler(event, context):
    message = "My Custom Message"
    client = boto3.client('sns')
    response = client.publish(
        TargetArn="YOUR_ARN",
        Message=message,
        MessageStructure='text',
        Subject='My Subject',
    )
Related