Seeking guidance on adding a footer to outbound verified emails with AWS SES or Lambda

2

Dear AWS Community,

I am currently working on a project where I need to add an official company footer to outbound emails using AWS Simple Email Service (SES) or Lambda. The footer needs to include the company details as required by the UK Companies Act.

I have successfully implemented email verification with SES and established the necessary email sending infrastructure. However, I'm now facing the challenge of incorporating the required footer information dynamically into outgoing emails.

Could anyone please provide guidance on how to achieve this? Specifically, I would like to know the best approach to automatically append the official company details, such as company name, registered address, and other mandated information, to the outgoing emails using either SES or Lambda.

Any insights, code snippets, or recommended AWS services would be highly appreciated. I'm eager to learn from the expertise within the community and leverage AWS services effectively to meet the UK Companies Act requirements.

Thank you in advance for your assistance!

Best regards,

Charles.

2 Answers
0

Hello Charles, Amazon SES supports personalised templates that can be leveraged to construct a mailer body with the required compliance.

Link: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html

These templates follow the JSON nomenclature and can be created using CLI or AWS SDK.

## In the HTML segment you can create a footer ##

{
  "Template": {
    "TemplateName": "MyTemplate",
    "SubjectPart": "Greetings, {{name}}!",
    "HtmlPart": "<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p> 
                           <footer> <p>Author: Charles UK Emailer---UK 
                           Companies Act -- Sample</p> <p>
                             <a href="mailto:hege@example.com">hege@example.com</a></p> 
                           </footer>",
    "TextPart": "Dear {{name}},\r\nYour favorite animal is {{favoriteanimal}}."
  }
}

##Type the following command to create a new template using the CreateTemplate API operation:##

aws ses create-template --cli-input-json file://mytemplate.json

I hope this helps, You can create upto 2000+ templates with Amazon SES per Region.

Thanks.

Regards, Varun

AWS
answered a year ago
  • Sorry for the delay. I am currently only a weekender with AWS dev. I have reviewed the instructions you sent.

    Thank you for providing them. However, I'm still a little confused.

    While I can successfully send an email using the "aws ses send-bulk-templated-email" command with an uploaded template (using "file://mybulkemail.json"), I am unsure how to use the template when sending emails through SES verified emails using any other method.

    Specifically, I want to ensure that any outgoing email from a verified email address using SES includes a footer. Although I can see the template in the SES console, I cannot find a way to attach it to the outgoing emails in the console.

    P.S. I am also experimenting with achieving this using AWS Pinpoint, which seems like an obvious approach, but it requires some learning.

    Many thanks.

    Charles.

0

Hi Charles,

On SES, you can use the policy-generator under the verified identities to ensure all outgoing emails use the same template. This policies can be further customised and mapped to a specific template. Amazon SES > Verified Identities > Authorization > Create / Generate Policy

Enter image description here

https://docs.aws.amazon.com/ses/latest/dg/using-policy-generator.html

It'll be good to explore Pinpoint as well, will be interested in knowing the details on how you implemented the same use-case in there.

Thanks.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions