Skip to content

Payment failed email template for Amazon SES.

A dunning email for subscription products: the plan, amount, card, and decline reason in one summary, then either the next retry date or, after the last retry, the date access ends.

Theme
Subject
Action needed: your Northwind payment didn’t go through
Preheader
We couldn’t charge $390.00 for Team (annual). Update your card to keep your account active.

Rendered from the same HTML as the SES template below, with the sample data filled in.

Download

Free under the MIT licence. The files follow the theme you pick above the preview.

Whole theme (.zip)Customise

Template data

The fields to send in TemplateData, with values from the first sample profile.

FieldTypeExample
accessEndsOnTextNov 13, 2026
amountText$390.00
cardBrandTextVisa
cardLast4Text4242
failureReasonTextCard declined by your bank
firstNameTextAda
invoiceUrlTexthttps://northwind.dev/invoices/NW-2026-0188
nextRetryDateTextNov 6, 2026
planNameTextTeam (annual)
preferencesUrlTexthttps://northwind.dev/settings/email
unsubscribeUrlTexthttps://northwind.dev/unsubscribe
updatePaymentUrlTexthttps://northwind.dev/settings/billing

How the logic works

One template covers the whole retry sequence. While retries remain, send nextRetryDate; on the final notice, send an empty nextRetryDate and it switches to the access-ends message.

{{#if nextRetryDate}}
  We’ll try again on {{nextRetryDate}}.
{{/if}}
{{#unless nextRetryDate}}
  This was our last automatic retry. Update by {{accessEndsOn}}.
{{/unless}}

SES Handlebars reference

Before you send it

  • Show only the card brand and last four digits. Never put more card details in an email.
  • Make updatePaymentUrl go straight to the billing page after sign-in.
  • Pick a tone that matches the stage: friendly on the first failure, clearer on the final notice.
  • Check with your payment provider whether it already sends its own failed-payment emails, so customers don't get two.
  • Send every field on every email, using "" for empty values, never null.

Use it in Amazon SES.

Create the template once, then send with your own data. Or open the editor, pick the Payment failed starter, change it visually, and publish to SES from there.

1. Save the template as payment-failed.json

Show the SES template JSON (39 KB)
{
  "TemplateName": "Payment-failed",
  "TemplateContent": {
    "Subject": "Action needed: your Northwind payment didn’t go through",
    "Html": "<!doctype html>\n<html lang=\"und\" dir=\"auto\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\">\n  <head>\n    <title>Action needed: your Northwind payment didn’t go through</title>\n    <!--[if !mso]><!-->\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <!--<![endif]-->\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <style type=\"text/css\">\n      #outlook a { padding:0; }\n      body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }\n      table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }\n      img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }\n      p { display:block;margin:13px 0; }\n    </style>\n    <!--[if mso]>\n    <noscript>\n    <xml>\n    <o:OfficeDocumentSettings>\n      <o:AllowPNG/>\n      <o:PixelsPerInch>96</o:PixelsPerInch>\n    </o:OfficeDocumentSettings>\n    </xml>\n    </noscript>\n    <![endif]-->\n    <!--[if lte mso 11]>\n    <style type=\"text/css\">\n      .mj-outlook-group-fix { width:100% !important; }\n    </style>\n    <![endif]-->\n    \n      <!--[if !mso]><!-->\n        <link href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700\" rel=\"stylesheet\" type=\"text/css\">\n<link href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\" rel=\"stylesheet\" type=\"text/css\">\n        <style type=\"text/css\">\n          @import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700);\n@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap);\n        </style>\n      <!--<![endif]-->\n\n    \n    \n    <style type=\"text/css\">\n      @media only screen and (min-width:480px) {\n        .mj-column-per-100 { width:100% !important; max-width: 100%; }\n.mj-column-per-40 { width:40% !important; max-width: 40%; }\n.mj-column-per-60 { width:60% !important; max-width: 60%; }\n      }\n    </style>\n    <style media=\"screen and (min-width:480px)\">\n      .moz-text-html .mj-column-per-100 { width:100% !important; max-width: 100%; }\n.moz-text-html .mj-column-per-40 { width:40% !important; max-width: 40%; }\n.moz-text-html .mj-column-per-60 { width:60% !important; max-width: 60%; }\n    </style>\n    \n    \n  \n    \n     \n    <style type=\"text/css\">\n.hk-card > table { border-collapse: separate; }\na { color: #4f46e5; }\n.hk-nowrap { white-space: nowrap; }\n@media (max-width: 480px) {\n  .hk-card { border-radius: 0 !important; }\n  .hk-nowrap { padding-left: 8px !important; padding-right: 8px !important; }\n}\n    </style>\n    \n  </head>\n  <body style=\"word-spacing:normal;background-color:#f4f4f6;\">\n    \n    <div style=\"display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;\">We couldn’t charge {{amount}} for {{planName}}. Update your card to keep your account active.</div>\n  \n    \n      <div\n         aria-label=\"Action needed: your Northwind payment didn’t go through\" aria-roledescription=\"email\" style=\"background-color:#f4f4f6;\" role=\"article\" lang=\"und\" dir=\"auto\"\n      >\n        \n      \n      <!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:0;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top;\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   style=\"font-size:0px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"height:24px;line-height:24px;\"\n      >&#8202;</div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:8px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:4px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:16px;line-height:1.6;text-align:left;color:#3f3f46;\"\n      ><table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td aria-hidden=\"true\" style=\"width:28px;height:28px;background:#4f46e5;border-radius:8px;color:#ffffff;font-weight:700;font-size:15px;line-height:28px;text-align:center;font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\">N</td><td style=\"padding-left:10px;font-weight:600;font-size:16px;color:#18181b;font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;letter-spacing:-0.01em;\">Northwind</td></tr></table></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"hk-card-outlook\" role=\"presentation\" style=\"width:600px;\" width=\"600\" bgcolor=\"#ffffff\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  class=\"hk-card\" style=\"background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;border-radius:12px;overflow:hidden;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;border-collapse:separate;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"border-radius:12px;direction:ltr;font-size:0px;padding:0;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" width=\"600px\" ><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:16px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:8px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:22px;font-weight:700;line-height:1.3;text-align:left;color:#18181b;\"\n      ><h2 style=\"margin:0;font-size:22px;line-height:1.3;font-weight:700;color:#18181b;letter-spacing:-0.01em;\">Your payment didn’t go through</h2></div>\n    \n                </td>\n              </tr>\n            \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:8px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:16px;line-height:1.6;text-align:left;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">Hi {{firstName}}, we couldn’t charge your {{cardBrand}} card ending {{cardLast4}} for your {{planName}} plan.</p></div>\n    \n                </td>\n              </tr>\n            \n              <tr>\n                <td\n                   align=\"center\" style=\"font-size:0px;padding:12px 32px;word-break:break-word;\"\n                >\n                  \n      <p\n         style=\"border-top:solid 1px #e4e4e7;font-size:1px;margin:0px auto;width:100%;\"\n      >\n      </p>\n      \n      <!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:solid 1px #e4e4e7;font-size:1px;margin:0px auto;width:536px;\" role=\"presentation\" width=\"536px\" ><tr><td style=\"height:0;line-height:0;\"> &nbsp;\n</td></tr></table><![endif]-->\n    \n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table></td></tr><tr><td class=\"\" width=\"600px\" ><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:0px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0;line-height:0;text-align:left;display:inline-block;width:100%;direction:ltr;\"\n      >\n        <!--[if mso | IE]><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" ><tr><td style=\"vertical-align:top;width:240px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-40 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:40%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:left;color:#71717a;\"\n      ><p style=\"margin:0 0 0px 0;\">Plan</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td><td style=\"vertical-align:top;width:360px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-60 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:60%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"right\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:right;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">{{planName}}</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td></tr></table><![endif]-->\n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table></td></tr><tr><td class=\"\" width=\"600px\" ><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:0px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0;line-height:0;text-align:left;display:inline-block;width:100%;direction:ltr;\"\n      >\n        <!--[if mso | IE]><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" ><tr><td style=\"vertical-align:top;width:240px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-40 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:40%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:left;color:#71717a;\"\n      ><p style=\"margin:0 0 0px 0;\">Amount</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td><td style=\"vertical-align:top;width:360px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-60 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:60%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"right\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:right;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">{{amount}}</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td></tr></table><![endif]-->\n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table></td></tr><tr><td class=\"\" width=\"600px\" ><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:0px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0;line-height:0;text-align:left;display:inline-block;width:100%;direction:ltr;\"\n      >\n        <!--[if mso | IE]><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" ><tr><td style=\"vertical-align:top;width:240px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-40 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:40%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:left;color:#71717a;\"\n      ><p style=\"margin:0 0 0px 0;\">Card</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td><td style=\"vertical-align:top;width:360px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-60 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:60%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"right\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:right;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">{{cardBrand}} ending {{cardLast4}}</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td></tr></table><![endif]-->\n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table></td></tr><tr><td class=\"\" width=\"600px\" ><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:0px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0;line-height:0;text-align:left;display:inline-block;width:100%;direction:ltr;\"\n      >\n        <!--[if mso | IE]><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" ><tr><td style=\"vertical-align:top;width:240px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-40 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:40%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:left;color:#71717a;\"\n      ><p style=\"margin:0 0 0px 0;\">Reason</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td><td style=\"vertical-align:top;width:360px;\" ><![endif]-->\n                \n      <div\n         class=\"mj-column-per-60 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:60%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"right\" style=\"font-size:0px;padding:5px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:14px;line-height:1.6;text-align:right;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">{{failureReason}}</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n              <!--[if mso | IE]></td></tr></table><![endif]-->\n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table></td></tr><tr><td class=\"\" width=\"600px\" ><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:16px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"center\" style=\"font-size:0px;padding:12px 32px;word-break:break-word;\"\n                >\n                  \n      <p\n         style=\"border-top:solid 1px #e4e4e7;font-size:1px;margin:0px auto;width:100%;\"\n      >\n      </p>\n      \n      <!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:solid 1px #e4e4e7;font-size:1px;margin:0px auto;width:536px;\" role=\"presentation\" width=\"536px\" ><tr><td style=\"height:0;line-height:0;\"> &nbsp;\n</td></tr></table><![endif]-->\n    \n    \n                </td>\n              </tr>\n            {{#if nextRetryDate}}\n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:8px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:16px;line-height:1.6;text-align:left;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">We’ll try again on {{nextRetryDate}}. To avoid any interruption, update your payment method before then.</p></div>\n    \n                </td>\n              </tr>\n            {{/if}}{{#unless nextRetryDate}}\n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:8px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:16px;line-height:1.6;text-align:left;color:#3f3f46;\"\n      ><p style=\"margin:0 0 0px 0;\">This was our last automatic retry. Update your payment method by {{accessEndsOn}} to keep your account active.</p></div>\n    \n                </td>\n              </tr>\n            {{/unless}}\n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:20px 32px;word-break:break-word;\"\n                >\n                  \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:separate;line-height:100%;\"\n      >\n        <tbody>\n          <tr>\n            <td\n               align=\"center\" bgcolor=\"#4f46e5\" role=\"presentation\" style=\"border:none;border-radius:10px;cursor:auto;mso-padding-alt:13px 24px;background:#4f46e5;\" valign=\"middle\"\n            >\n              <a\n                 href=\"{{updatePaymentUrl}}\" style=\"display:inline-block;background:#4f46e5;color:#ffffff;font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:15px;font-weight:600;line-height:1.2;margin:0;text-decoration:none;text-transform:none;padding:13px 24px;mso-padding-alt:0px;border-radius:10px;\" target=\"_blank\"\n              >\n                Update payment method\n              </a>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n                </td>\n              </tr>\n            \n              <tr>\n                <td\n                   align=\"left\" style=\"font-size:0px;padding:8px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:13px;line-height:1.6;text-align:left;color:#71717a;\"\n      ><p style=\"margin:0 0 0px 0;\">Questions about this charge? Reply to this email or <a href=\"{{invoiceUrl}}\" style=\"color:#4f46e5;text-decoration:underline;\" target=\"_blank\">view the invoice</a>.</p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:16px 0px;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\"\n      >\n        <tbody>\n          <tr>\n            <td  style=\"vertical-align:top;padding:0;\">\n              \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   align=\"center\" style=\"font-size:0px;padding:8px 32px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"font-family:Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;font-size:12px;line-height:1.6;text-align:center;color:#71717a;\"\n      ><p style=\"margin:0 0 9px 0;\">You’re receiving this email because of your Northwind subscription.</p><p style=\"margin:0 0 9px 0;\">Northwind Inc. · 548 Market St, San Francisco, CA 94104</p><p style=\"margin:0 0 0px 0;\"><a href=\"{{preferencesUrl}}\" style=\"color:#4f46e5;text-decoration:underline;\" target=\"_blank\">Email preferences</a> · <a href=\"{{unsubscribeUrl}}\" style=\"color:#4f46e5;text-decoration:underline;\" target=\"_blank\">Unsubscribe</a></p></div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n            </td>\n          </tr>\n        </tbody>\n      </table>\n    \n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n    \n      \n      <div  style=\"margin:0px auto;max-width:600px;\">\n        \n        <table\n           align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%;\"\n        >\n          <tbody>\n            <tr>\n              <td\n                 style=\"direction:ltr;font-size:0px;padding:0;text-align:center;\"\n              >\n                <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n            \n      <div\n         class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n      >\n        \n      <table\n         border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top;\" width=\"100%\"\n      >\n        <tbody>\n          \n              <tr>\n                <td\n                   style=\"font-size:0px;word-break:break-word;\"\n                >\n                  \n      <div\n         style=\"height:24px;line-height:24px;\"\n      >&#8202;</div>\n    \n                </td>\n              </tr>\n            \n        </tbody>\n      </table>\n    \n      </div>\n    \n          <!--[if mso | IE]></td></tr></table><![endif]-->\n              </td>\n            </tr>\n          </tbody>\n        </table>\n        \n      </div>\n    \n      \n      <!--[if mso | IE]></td></tr></table><![endif]-->\n    \n    \n      </div>\n    \n  </body>\n</html>\n  ",
    "Text": "Northwind\n\nYour payment didn’t go through\n\nHi {{firstName}}, we couldn’t charge your {{cardBrand}} card ending {{cardLast4}} for your {{planName}} plan.\n\n────────────────────────\n\nPlan\n\n{{planName}}\n\nAmount\n\n{{amount}}\n\nCard\n\n{{cardBrand}} ending {{cardLast4}}\n\nReason\n\n{{failureReason}}\n\n────────────────────────\n\n{{#if nextRetryDate}}We’ll try again on {{nextRetryDate}}. To avoid any interruption, update your payment method before then.{{/if}}\n\n{{#unless nextRetryDate}}This was our last automatic retry. Update your payment method by {{accessEndsOn}} to keep your account active.{{/unless}}\n\nUpdate payment method: {{updatePaymentUrl}}\n\nQuestions about this charge? Reply to this email or view the invoice ({{invoiceUrl}}).\n\nYou’re receiving this email because of your Northwind subscription.\n\nNorthwind Inc. · 548 Market St, San Francisco, CA 94104\n\nEmail preferences ({{preferencesUrl}}) · Unsubscribe ({{unsubscribeUrl}})\n"
  }
}

2. Create it in SES

aws sesv2 create-email-template --cli-input-json file://payment-failed.json

3. Send with your data

{
  "FromEmailAddress": "Northwind <hello@northwind.example>",
  "Destination": {
    "ToAddresses": [
      "ada@example.com"
    ]
  },
  "Content": {
    "Template": {
      "TemplateName": "Payment-failed",
      "TemplateData": "{\"firstName\":\"Ada\",\"planName\":\"Team (annual)\",\"amount\":\"$390.00\",\"cardBrand\":\"Visa\",\"cardLast4\":\"4242\",\"failureReason\":\"Card declined by your bank\",\"accessEndsOn\":\"Nov 13, 2026\",\"updatePaymentUrl\":\"https://northwind.dev/settings/billing\",\"invoiceUrl\":\"https://northwind.dev/invoices/NW-2026-0188\",\"preferencesUrl\":\"https://northwind.dev/settings/email\",\"unsubscribeUrl\":\"https://northwind.dev/unsubscribe\",\"nextRetryDate\":\"Nov 6, 2026\"}"
    }
  },
  "ConfigurationSetName": "transactional"
}
aws sesv2 send-email --cli-input-json file://send.json
Show the plain-text part
Northwind

Your payment didn’t go through

Hi {{firstName}}, we couldn’t charge your {{cardBrand}} card ending {{cardLast4}} for your {{planName}} plan.

────────────────────────

Plan

{{planName}}

Amount

{{amount}}

Card

{{cardBrand}} ending {{cardLast4}}

Reason

{{failureReason}}

────────────────────────

{{#if nextRetryDate}}We’ll try again on {{nextRetryDate}}. To avoid any interruption, update your payment method before then.{{/if}}

{{#unless nextRetryDate}}This was our last automatic retry. Update your payment method by {{accessEndsOn}} to keep your account active.{{/unless}}

Update payment method: {{updatePaymentUrl}}

Questions about this charge? Reply to this email or view the invoice ({{invoiceUrl}}).

You’re receiving this email because of your Northwind subscription.

Northwind Inc. · 548 Market St, San Francisco, CA 94104

Email preferences ({{preferencesUrl}}) · Unsubscribe ({{unsubscribeUrl}})

Make it yours in the editor.

Change the copy and brand visually, preview with your own sample data, and publish to SES.