> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getsendbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Email Templates

> Create reusable email templates

Email Templates allow you to create, save, and reuse email designs.

1. Click **Create template** from the email templates page
2. Use the block-based editor to compose your email content and design
3. Click the **Save** button to sync your changes to AWS SES

## Send Email with Template

After saving your template, you can send emails using the AWS SES API. The template is stored in AWS SES with the name format(i.e.,`sendbase-<template id>`).

<CodeGroup>
  ```bash AWS CLI theme={null}
  aws sesv2 send-email \
    --region "<your-region>" \
    --from-email-address "<from-email-address>" \
    --destination "ToAddresses=<recipient-email-address>" \
    --content 'Template={TemplateName=<template-name>,TemplateData={"<key>": "<value>"}}'
  ```

  ```javascript JavaScript SDK theme={null}
  import * as AWS from "@aws-sdk/client-sesv2";

  const client = new AWS.SESv2({
    region: "<your-region>",
  });

  await client.sendEmail({
    FromEmailAddress: "<from-email-address>",
    Destination: {
      ToAddresses: ["<recipient-email-address>"],
    },
    Content: {
      Template: {
        TemplateName: "<template-name>",
        TemplateData: JSON.stringify({ "<key>": "<value>" }),
      },
    },
  });
  ```
</CodeGroup>

<Info>
  If you'd like to manage the content by `git`, copy the HTML and plain text
  using the **Copy HTML** button from the test email actions menu.
</Info>

## Auto-Save

The editor automatically saves your changes to the database as you type (with 1 second debounce). These are stored as "dirty" values and don't sync to AWS SES until you explicitly click **Save**.

## Test Emails

Send test emails directly from the template editor to preview your design. Test emails use your current unsaved changes, allowing you to test before committing to AWS SES.

## Template Variable

Template variables allow you to write personalized emails for each recipient.

<video autoPlay muted loop playsInline className="w-full rounded-xl" src="https://mintcdn.com/nosubs/aWstFxNRErjI28p7/assets/broadcasts-template-variable.mp4?fit=max&auto=format&n=aWstFxNRErjI28p7&q=85&s=ac4d7bad4e696e89b5510da558c20f27" data-path="assets/broadcasts-template-variable.mp4" />

When the email is sent, template variables are replaced with the template data.

<Warning>If you personalize an email you have to pass template data. </Warning>
