Help Campaigns
Templates
Templates are emails you write once and keep as Amazon SES templates in your own AWS account, so campaigns and your own app can send them by name. This page covers the template list, the editor, personalization, test sends, and how campaigns and your app use templates.
What a template is
A template is an Amazon SES email template: a name, a subject, an HTML part and a text part. SendForever reads and writes your templates directly in Amazon SES, in your AWS account and region. It keeps no copy of them. Templates that your app or the AWS console created show up too.
A template written in SendForever stores what you wrote, and its design, as HTML comments inside its own HTML (such as <!-- sendforever:content -->). That is how it opens in the same editor again. If those comments are removed, for example when someone edits the template elsewhere, it opens as plain HTML.
Which templates a domain sees depends on whether the domain is isolated (see Domains):
- An isolated domain has templates of its own, held by its Amazon SES tenant. Its list shows only those.
- A domain that is not isolated shares the templates of your AWS account with every other domain that is not isolated. Its list says Shared with every domain.
Templates need a connected AWS account (see AWS account).
Team owners and admins can create, save, test and delete templates. Members can open templates, preview them and see the API snippets, but cannot change them.
The template list
Choose a domain in the header, then open Templates. The table lists each template's Name, when it was Created (unless the domain is isolated) and how many of your team's Campaigns send it. A template only your app sends shows 0 there. Click a column heading to sort by it. Click a row to open the template. When there are more templates than fit on one page, Load more shows the next ones.
On an isolated domain, a second section, Not in a domain, lists the templates in your AWS account that belong to no domain, such as ones your app or the AWS console made. To add one of them to the domain, click Add to followed by the domain's name.
If you open a template that another of your domains holds, SendForever switches the header to that domain.
Create a template
- On the Templates page, click New template.
- Choose what kind of email it is: Marketing (campaigns to your audiences) or Transactional (emails your app sends one person at a time).
- Pick a layout at the top right: Basic, Basic full or Plain. These are Postmark's layouts: a white card on gray, a white band across gray, or white throughout. The previews follow your choice.
- Click one of the cards under Start from scratch, or an example under Or start from an example.
- The template opens on its own page. Enter a Name, a Subject and, if you like, Preview text (for HTML it goes in the HTML itself), then write the email.
- Click Create template. Only now is the template created in Amazon SES.
The name can have up to 64 letters, numbers, dashes and underscores, like welcome-email. If you type anything else, such as "Summer Promo", the field turns it into a valid name (summer-promo) when you leave it. Your app sends the template by this name, so the name cannot change after the template is created. If Amazon SES already has a template with that name, the field says so.
A new template belongs to the domain chosen in the header when that domain is isolated. The Name field then says which domain it belongs to.
Starting points
Marketing starting points open in the visual editor, with the unsubscribe link and, once your team has one, its postal address in the footer:
- Travel: trips to book, each with its price.
- Announcement: one piece of news and one button.
- Promotion: an offer, its code and its deadline.
- Newsletter: a few pieces of news and a list.
- Roundup: four stories with image and button.
- Letter: words only, as one person writes.
Transactional starting points are Postmark's templates. They open as HTML and keep the variables your app fills in, such as {{name}} and {{action_url}}:
- Welcome, Invitation, Failed payment, Invoice, Receipt and Password reset.
To start from scratch, choose Blank (an empty email in the visual editor), Markdown (an empty email written in Markdown) or Your own HTML (paste an email designed elsewhere). A blank marketing email has the unsubscribe link and postal address in its footer. A blank transactional one does not.
SendForever fills in your team's name, your name and your team's postal address where Postmark's templates had placeholders. Add the postal address under your team's Settings first. Without it, the transactional starting points show your team's name in its place. A template made before SendForever filled these in may still have Postmark's sample address. Its editor says so, and Use the team's details replaces it. Save to keep the change.
The editor
The editor has an Edit tab and a Preview tab. The Full screen button at the right of the same bar makes the editor fill the page. Press Escape to leave full screen. You can write an email in three ways: the visual editor, Markdown and HTML.
Visual editor
The toolbar has headings, bold, italic, underline, strikethrough, bulleted and numbered lists, quotes, links, alignment, undo and redo, plus:
- Callout box: puts the selected paragraphs in a shaded box, or takes them out of it.
- Button: opens a dialog for the Words on the button, the Link and the Position (Left or Centered). Double-click a button in the email to change it.
- Divider: a line across the email.
- Image: see Images below.
The Insert menu adds these where the cursor is: the recipient's Email address ({{email}}), their Name ({{name}}), an Unsubscribe link and, once your team has one, its Postal address. Name, or "there" adds their name, or a word for someone without one: {{#if name}}{{name}}{{else}}there{{/if}}. Change "there" to your own word.
Click Design to change how the email is laid out around what you write. The editor shows each change as you make it.
- Layout: Basic, Basic full or Plain.
- Accent: the color of buttons and links. If the accent is too light to read on white, links stay dark and button labels turn dark.
- Logo: shown at the top. Without a logo, the team's name shows there. Choose a Logo size of Small, Medium or Large.
- Footer: switches for the team's Postal address and the Unsubscribe link. The postal address switch stays off until the team has an address in its settings.
Images
Images are stored in your AWS account, in the data bucket the stack made. CloudFront in your account serves them from there to every inbox. They never pass through SendForever.
- Click Image in the toolbar, or drop or paste an image straight into the email.
- Enter a Description: screen readers read it out, and inboxes that block images show it.
- Under Upload an image, choose a file, or pick one under Uploaded before, which shows your latest images.
PNG and JPEG images wider than 1,200 pixels are scaled down to that width. Other image types, such as WebP, are redrawn as PNG. A GIF is uploaded as it is, so it stays animated. The logo under Design is uploaded the same way.
To delete an image from your AWS account, click Remove under it in Uploaded before. It is also taken out of the email you are writing. Emails already sent, and other templates that use the image, stop showing it, which can take up to a day. If Remove is missing, update the stack from the AWS account page.
The Image button and the logo only appear once your stack serves images. If your AWS account refuses an upload, update the stack from the AWS account page and try again.
Markdown
In Markdown, # makes a heading, **bold** and *italic* mark words, [words](https://…) makes a link and - starts a list. Tables and strikethrough work too. The Preview tab shows the email in the editor's layout. The Markdown itself is also the email's text version.
Only an empty email can start over in Markdown. Open the more actions menu (the ellipsis button next to Save) and choose Write in Markdown. From Markdown you can move on to Edit in the visual editor or Edit as HTML, but you cannot go back, because the Markdown turns into the email it describes.
HTML
Templates made outside SendForever, and the Your own HTML starting point, open in an HTML code editor. From the visual editor, choose Edit as HTML in the more actions menu to edit the email's full HTML in its layout. Back to the visual editor appears only while the HTML still holds what the visual editor wrote. Only that part and the design come back. Other changes to the HTML are dropped.
An email in HTML also has a Visual tab, beside Edit. It shows the email as designed and lets you click in it and type, so you can change its words without touching its HTML or its design. Click a link and choose Change link to send it elsewhere, or click an image and choose Change image to put another in its place, or Remove image to take it out of the email. The image stays in your AWS account. Pressing Enter starts a new line, and pasted text takes the style of where it lands. For anything else, such as a new section or another color, use the Edit tab. If the email repeats or leaves out table rows with {{#each}} or {{#if}}, the Visual tab says so and the email is changed in the Edit tab only.
Subject, preview text and text version
- Subject: required, up to 255 characters. It can use variables, such as
{{name}}. - Preview text: the text inboxes show beside the subject. SendForever adds it, hidden, at the top of the email. In HTML mode the field cannot be typed in: it shows the words of the first hidden block of your HTML (an element styled
display:none), which is where you change them. - Text version: what mail clients display when they do not show HTML. Click Text version at the bottom of the editor to see it. If you leave it empty, SendForever makes it from the HTML whenever you save or send a test. Click Fill from HTML to start one from the HTML and edit it by hand. If a text version you wrote has no unsubscribe link, Add the unsubscribe link appears. In Markdown, the Markdown is the text version.
Personalization and the unsubscribe link
Amazon SES fills variables written in double braces, like {{firstName}} or {{user.name}}, from the data each email is sent with.
- Campaigns fill
{{email}}with each person's address,{{name}}with their name, and{{amazonSESUnsubscribeUrl}}with their own unsubscribe link. They fill nothing else. - A person's name comes from the import's name column, your app's
subscribecall or Add contact (see Audiences and contacts). Someone without a name gets nothing in its place, so write a greeting that reads well either way:{{#if name}}Hi {{name}},{{else}}Hi,{{/if}}. - Other variables only work when your app sends the email with values of its own.
The unsubscribe link is a link to {{amazonSESUnsubscribeUrl}}. Each campaign email fills it with the person's own link to the domain's preferences page, on its links host. Campaigns refuse to send without it. Saving the template marks the link ses:no-track, so a domain that tracks clicks leaves it unchanged. You can add it with the Footer switch under Design, the Insert menu, or Add in the bar below the editor. In Markdown and HTML, the Insert menu adds the unsubscribe link or the postal address at the end of the email. Leave the unsubscribe link off in emails your app sends, such as receipts. See Audiences and contacts for what happens when someone unsubscribes.
The bar below the editor, For campaigns, shows what campaigns need from the email as it is now: an Unsubscribe link, your Postal address (the CAN-SPAM Act asks for one in marketing email) and Preview text. Each missing item says so. It offers Add where the item can be added, or Add one in settings when the team has no postal address yet.
Preview and test sends
The Preview tab shows the email as it is sent, on Desktop or Mobile.
To see it in a real inbox:
- Click Send test.
- Under Send from, choose one of your domains that is ready to send.
- Under Send to, keep your own address, or enter up to 5 addresses separated by commas to see the email in several inboxes.
- If you like, enter a From name, the name your inbox shows beside the address. It starts as the domain's Sender name (see Domains). A change here applies to this test only.
- Click Send test.
The test sends what is on screen, saved or not, so a test never publishes a change. Each variable shows its own name, like [firstName]. The test goes through the domain's configuration set, so it appears in the activity log (see Activity). If it does not arrive, the activity log says why within a minute.
Amazon SES fills a block such as {{#if name}} only in a template it has saved. Save the template before you click Send test, and the test sends the saved template. If a template that uses a block has unsaved changes, the test is refused and the window tells you to save first.
A domain sends up to 5 test emails an hour. While your Amazon SES account is in the sandbox, it only delivers to verified addresses. The first test asks Amazon SES to email your address a link to verify it. Open the link, then send the test again. See Production access.
Save, edit and delete
Click Save to write your changes to Amazon SES. Whatever sends the template by name, such as your app or a campaign, uses the saved version from then on.
If the template changed in Amazon SES since you opened it, for example because someone else saved it, Save refuses to write over that change and says so. Amazon SES keeps no earlier versions. Copy what you changed, reload the page and make your changes again.
To delete a template, click the trash button on its row in the list, or choose Delete template in the editor's more actions menu. After that, anything that sends it by name, such as your app, can no longer send it. If a domain holds the template, SendForever first releases it from the domain's tenant, because Amazon SES refuses to delete it otherwise. You cannot delete or change a template that a scheduled, sending or paused campaign sends until that campaign ends, is stopped or is cancelled. A campaign paused for more than 14 days no longer holds it, as it can no longer be resumed. That way, the email that passed the campaign's checks is the email that goes out.
If a template was deleted in the AWS console or by your app, opening it says Amazon SES has no template named followed by its name.
Use a template in a campaign
On a campaign's page, choose the template under Template. The subject and the email come from it. The list offers the templates of the campaign's domain, or your account's templates when the domain is not isolated. Before sending, the campaign checks the template. It must have the unsubscribe link, use no variable other than {{email}} and {{name}}, and be under 102 KB so Gmail does not clip it. The campaign also warns about a missing preview text, a missing postal address, a text version without the unsubscribe link, and a subject over 70 characters. See Campaigns.
Send a template from your app
Your app sends a template by name with the Amazon SES SendEmail operation, passing the variables as TemplateData. To get the code, open the template, open the more actions menu and choose API snippets. Choose the domain to send from under Send from, then the AWS CLI, PHP or Node.js tab. Each snippet names the domain's configuration set and, for an isolated domain, its tenant. It fills every variable with an example value. For a template named welcome-email that uses one variable, {{name}}, the PHP snippet looks like this:
use Aws\SesV2\SesV2Client;
$ses = new SesV2Client(['region' => 'us-east-1']);
$ses->sendEmail([
'FromEmailAddress' => '[email protected]',
'Destination' => ['ToAddresses' => ['[email protected]']],
'ConfigurationSetName' => 'sendforever-example-com',
'Content' => ['Template' => [
'TemplateName' => 'welcome-email',
'TemplateData' => '{"name":"[name]"}',
]],
]);
Replace [email protected] and the example values with your own. Your app uses the sending key of one of your domains, from the SMTP & API tab of the domain's settings (see Sending email). The SendForever API and MCP server can also list, read and save templates (see API and MCP).
Common questions
Why can't my campaign use {{firstName}}?
Campaigns fill only {{email}}, {{name}} and the unsubscribe link. {{name}} is the person's whole name as it was imported or sent by your app. There is no separate first name. Amazon SES drops every email whose data is missing a variable, so a campaign refuses to send a template that uses any other variable. Use other variables in emails your app sends with values of its own.
My campaign says the template has no unsubscribe link. How do I add one?
Open the template and click Add next to No unsubscribe link in the bar below the editor, or turn on Unsubscribe link under Design, then click Save. In HTML, link to {{amazonSESUnsubscribeUrl}}.
Can I rename a template?
No. Your app and campaigns send a template by its name, which is fixed when the template is created. To use another name, create a new template.
Why does my template open as HTML instead of in the visual editor?
A template opens as HTML when it was made outside SendForever, when it was made from a transactional starting point or Your own HTML, or when the comments SendForever keeps in its HTML were removed. The visual editor cannot rebuild a design it did not make. To change the words of such an email without touching its HTML, use its Visual tab.
Can I edit a template in the AWS console?
Yes. Amazon SES is where templates live, so SendForever shows the change the next time you open the template. Keep the HTML comments SendForever wrote if you want the template to open in the visual editor again.
Why is the Image button missing, or my image not loading?
The Image button appears for team owners and admins once your stack serves images. If it is missing, update the stack from the AWS account page. An account's first image needs CloudFront set up to serve it, which takes AWS a few minutes to finish.
Why didn't my test email arrive?
Check the activity log, which says why within a minute. While your Amazon SES account is in the sandbox, first verify your address with the link Amazon SES emails you. A domain sends up to 5 tests an hour, and a test can only go out from a domain that is ready to send.
Why doesn't a template show in this domain's list?
An isolated domain lists only the templates it holds. Look under Not in a domain and click Add to to add it to this domain. Or switch to the domain that holds it, in the header.
Does saving change emails already sent?
No. Emails already sent stay as they were. Saving changes the template in Amazon SES, and whatever sends it by name uses the new version from then on.
Still stuck?