Skip to content

Email templates ​

A template holds the content and layout of one email. Templates are written in RCML, Rule's email markup, which the assistant writes for you. These tools list, read, create, change, copy, delete and preview email templates.

Good to know ​

  • Campaigns and automations create their own templates. You only need these tools to change an email's content, to copy a template, or to preview it.
  • Unused templates are removed. Every night, Rule deletes templates that are not used by any campaign, automation email or variant and have not been changed for 7 days.
  • Styling comes from a brand style. New content gets its colours, fonts and logo from a brand style, so the assistant only writes the content.
  • Email only. SMS templates are not supported.
  • Every tool also takes the optional account_id (see Accounts). It is left out of the tables below.

list-templates ​

Lists the account's email templates with their id, name and dates.

ParameterTypeRequiredDescription
pagenumberNoPage number, starting at 1.
per_pagenumberNoTemplates per page, up to 100. Defaults to 100.
  • The list includes the templates of campaigns, variants and automation emails, as well as templates not used by anything, without saying which is which. Before changing or deleting a template you named only by name, the assistant confirms which one you mean.
  • A page can hold fewer templates than per_page while there are more pages.

Try asking: "List my email templates."

get-email-template ​

Reads one template, including its full content. The assistant uses this before changing an email. To see what an email looks like, use preview-email-template instead.

If someone has unsaved changes to the template in Rule's editor, this returns those unsaved changes, which may differ from what is sent.

ParameterTypeRequiredDescription
template_idnumberYesThe template's id.

Try asking: "What does the text of template 123 say?"

create-email-template ​

Creates a template from content written in RCML. The template is styled with a brand style and checked before it is saved; content that is not valid is refused.

ParameterTypeRequiredDescription
namestringYesTemplate name.
templateobjectYesThe email as an RCML document.
brand_style_idnumberNoThe brand style to use. Defaults to the account's default brand style.

Try asking: "Create an email template called 'Welcome' with a headline, a short intro and a button, using my default brand style."

update-email-template ​

Replaces a template's content. The assistant reads the template first, makes the change and saves the whole template back.

ParameterTypeRequiredDescription
template_idnumberYesThe template's id.
namestringYesTemplate name.
templateobjectYesThe complete new content.
brand_style_idnumberNoRestyle the template with this brand style. This overwrites colours, fonts, logo and social links, including manual changes made in Rule. Leave out to change only the content.
  • A text, heading, button or logo you add without a style gets the standard style for its kind, so it matches the rest of the email. Elements that are already in the template are left as they are.

Unsaved changes in Rule

If someone is editing the template in Rule's editor and has not saved yet, updating it here publishes their unsaved changes and then overwrites them. The result is what subscribers get from then on. For a template of a scheduled campaign or an active automation, the assistant asks you to save or discard the changes in Rule first.

Try asking: "Change the headline of template 123 to 'Welcome aboard' and keep everything else."

copy-email-template ​

Duplicates a template, in the same account or into another account you have access to.

ParameterTypeRequiredDescription
template_idnumberYesThe template to copy.
new_namestringNoName of the copy. Defaults to Template - <date and time>, as in Rule's editor.
source_account_idnumberNoTo copy to another account: the account to copy from. Give it together with target_account_id.
target_account_idnumberNoThe account to copy to.
target_brand_style_idnumberNoFor a copy to another account: the brand style to apply.

When copying to another account, the copy is adapted to it:

  • Brand style: the brand style with the same name is used, otherwise the target account's default. If the target account has no brand style at all, nothing is copied; copy one first with copy-brand-style.
  • Images are copied into the target account's image bank.
  • Tags, segments and custom fields used in the email are matched by name. One without a match is cleared and listed in warnings; Rule's editor shows it as an empty condition to fill in.

Try asking: "Copy template 123 to my Norwegian account."

delete-email-template ​

Permanently deletes a template.

ParameterTypeRequiredDescription
template_idnumberYesThe template's id.
confirmtrueYesMust be true. The assistant asks you first.

Check that the template is not in use

Neither Rule nor the tool can check whether a campaign, automation email or variant still uses the template. If one does, its recipients are still routed to the deleted template when sending, and Rule later removes that email or variant during its nightly clean-up. To remove a variant together with its content, use delete-dynamic-set instead.

Try asking: "Delete template 123."

preview-email-template ​

Shows what a template looks like as an email.

ParameterTypeRequiredDescription
template_idnumberYesThe template's id. The assistant finds it from the campaign, automation or variant you mention.
  • In clients that support it, such as Claude, the preview appears as an interactive panel in the chat. Links in it open in a new tab.
  • In other clients, the assistant receives the email's HTML and shows it another way.
  • Only saved templates can be previewed. If someone has unsaved changes in Rule's editor, the preview shows those changes, which may differ from what is sent.
  • External images and fonts load through a temporary link that expires after 6 hours. Preview again to reload them.
  • A very large email cannot be previewed; open it in Rule instead.
  • Each preview adds the whole email to the conversation, so the assistant previews after a round of changes rather than after every small edit.

Try asking: "Show me what the email of campaign 1234 looks like."