scenarios/features/sesv2_weekly_mailer/content/30_SPECIFICATION.md
Use the Amazon Simple Email Service (SES) v2 API to manage a subscription list for a weekly newsletter.
At the start of the workflow, print this header:
Welcome to the Amazon SES v2 Coupon Newsletter Workflow!
This workflow will help you:
- Prepare a verified email identity and contact list for your newsletter.
- Gather subscriber email addresses and send them a welcome email.
- Send a weekly coupon newsletter to your subscribers using email templates.
- Monitor your sending activity and metrics in the AWS console.
Let's get started!
verified email address from the user. This will be used as the from address, and the user will need to click a verification link in their email before continuing to part 3.EmailIdentity: Value of the verified email given by the user.AlreadyExistsException: If the identity already exists, skip this step and proceed with the next operation. This error can be safely ignored.NotFoundException: If the identity does not exist, fail the workflow and inform the user that the provided email address is not verified.LimitExceededException: If the limit for email identities is exceeded, fail the workflow and inform the user that they have reached the limit for email identities.weekly-coupons-newsletter.
ContactListName: weekly-coupons-newsletterAlreadyExistsException: If the contact list already exists, skip this step and proceed with the next operation. This error can be safely ignored.LimitExceededException: If the limit for contact lists is exceeded, fail the workflow and inform the user that they have reached the limit for contact lists.[email protected], [email protected], etc., also known as plus addressing).{user email}+ses-weekly-newsletter-{i}@{user domain}.{user-email} is the portion up to the first @ (0x40, dec 64). The {user domain} is everything after the first @.weekly-coupons-newsletter contact list.
ContactListName: weekly-coupons-newsletterEmailAddress: The email address provided by the user.AlreadyExistsException: If the contact already exists, skip this step for that contact and proceed with the next contact. This error can be safely ignored.welcome.html file.
FromEmailAddress: Use the verified_email address provided in Prepare the Application.Destination.ToAddresses: The email address provided by the user.Content.Simple.Subject.Data: "Welcome to the Weekly Coupons Newsletter"Content.Simple.Body.Text.Data: Read the content from the welcome.txt file.Content.Simple.Body.Html.Data: Read the content from the welcome.html file.SendEmail for "Send the Coupon Newsletter"weekly-coupons with the following content:
Weekly Coupons Newslettercoupon-newsletter.html file.coupon-newsletter.txt file.{{amazonSESUnsubscribeUrl}}.TemplateName: weekly-couponsTemplateContent:
Subject: Weekly Coupons NewsletterHtml: Read from the coupon-newsletter.html fileText: Read from the coupon-newsletter.txt fileAlreadyExistsException: If the template already exists, skip this step and proceed with the next operation. This error can be safely ignored.LimitExceededException: If the limit for email templates is exceeded, fail the workflow and inform the user that they have reached the limit for email templates.weekly-coupons-newsletter contact list.
ContactListName: weekly-coupons-newsletterNotFoundException: If the contact list does not exist, fail the workflow and inform the user that the contact list is missing.weekly-coupons template to each contact in the list.
Destination:
ToAddresses: One email address from the ListContacts response (each email address must get a unique SendEmail call for tracking and unsubscribe purposes).Content:
Template:
TemplateName: weekly-couponsTemplateData: JSON string representing an object with one key, coupons, which is an array of coupon items. Each coupon entry in the array should have one key, details, with the details of the coupon. See sample_coupons.json.FromEmailAddress: (Use the verified email address from step 1)ListManagementOptions:
ContactListName: weekly-coupons-newsletter to correctly populate Unsubscribe headers and the {{amazonSESUnsubscribeUrl}} value.AccountSuspendedException: If the account is suspended, fail the workflow and inform the user that their account is suspended.MailFromDomainNotVerifiedException: If the sending domain is not verified, fail the workflow and inform the user that the sending domain is not verified.MessageRejected: If the message is rejected due to invalid content, fail the workflow and inform the user that the message content is invalid.SendingPausedException: If sending is paused, fail the workflow and inform the user that sending is currently paused for their account.For more information on using templates with SES v2, refer to the Amazon SES Developer Guide.
ContactListName: weekly-coupons-newsletterNotFoundException: If the contact list does not exist, skip this step and proceed with the next operation. This error can be safely ignored.NotFoundException: If the contact list does not exist, skip this step and proceed with the next operation. This error can be safely ignored.TemplateName: weekly-couponsNotFoundException: If the email template does not exist, skip this step and proceed with the next operation. This error can be safely ignored.NotFoundException: If the email template does not exist, skip this step and proceed with the next operation. This error can be safely ignored.EmailIdentity: Value of the verified email given by the user in part 1.NotFoundException: If the email identity does not exist, skip this step and proceed with the next operation. This error can be safely ignored.Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0