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

# emailTemplates

> List email templates, optionally filtered by name or trigger.

**Required scopes:** [`marketing_templates_read`](/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

## Arguments

<ResponseField name="after" type="String">
  Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
</ResponseField>

<ResponseField name="before" type="String">
  Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
</ResponseField>

<ResponseField name="first" type="Int">
  Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
</ResponseField>

<ResponseField name="last" type="Int">
  Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
</ResponseField>

<ResponseField name="orderBy" type={<a href="/docs/api-reference/v3/reference/marketing/email-template-sort-key">EmailTemplateSortKey</a>}>
  Which key to sort by (defaults to the first key, newest-first). Combine with `reverse` to flip direction.
</ResponseField>

<ResponseField name="query" type="String">
  Case-insensitive substring match on the template name. At most 200 characters.
</ResponseField>

<ResponseField name="reverse" type="Boolean">
  Reverses the sort direction selected by `orderBy` (or its default).
</ResponseField>

<ResponseField name="trigger" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-trigger">MarketingTrigger</a>}>
  Only include templates for this trigger.
</ResponseField>

## Returns

<ResponseField name="emailTemplates" type={<a href="/docs/api-reference/v3/pagination">EmailTemplateConnection!</a>} required>
  A paginated list of EmailTemplate items.

  <Expandable title="fields" lazyRender>
    <ResponseField name="edges" type={<a href="/docs/api-reference/v3/pagination">[EmailTemplateEdge!]!</a>} required>
      The list of edges (each a node plus its pagination `cursor`).

      <Expandable title="fields" lazyRender>
        <ResponseField name="cursor" type="String!" required>
          Opaque cursor for this item; pass to `after`/`before` to page from here.
        </ResponseField>

        <ResponseField name="node" type={<a href="/docs/api-reference/v3/reference/marketing/email-template">EmailTemplate!</a>} required>
          The item at this edge.

          <Expandable title="fields" lazyRender>
            <ResponseField name="contentBackgroundColor" type="String!" required>
              The content canvas background, as set under Email styles in the email builder.
            </ResponseField>

            <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
              When the template was created.
            </ResponseField>

            <ResponseField name="emailBackgroundColor" type="String!" required>
              The email background, as set under Email styles in the email builder.
            </ResponseField>

            <ResponseField name="id" type="ID!" required>
              The id of this template.
            </ResponseField>

            <ResponseField name="legacyId" type="String!" required>
              The template's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
            </ResponseField>

            <ResponseField name="linkColor" type="String">
              The default link color, as set under Email styles in the email builder. Null when the merchant left it unset.
            </ResponseField>

            <ResponseField name="name" type="String!" required>
              The merchant-facing name of the template.
            </ResponseField>

            <ResponseField name="preview" type={<a href="/docs/api-reference/v3/reference/marketing/email-template-preview">EmailTemplatePreview</a>}>
              Render this template, to see what recipients get. Use a width of about 375 for a phone.

              **Requires:** [`marketing_templates_read`](/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

              <Expandable title="fields" lazyRender>
                **Arguments**

                <ResponseField name="eventId" type="ID">
                  Render with this recent event's data instead of sample data: a 24-character hex event id. A well-formed id that can't be found falls back to sample data.
                </ResponseField>

                <ResponseField name="width" type="Int">
                  Viewport width of the screenshot, 320-1200 pixels.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="previewText" type="String">
              The preview text shown after the subject in an inbox. Null when the merchant left it unset.
            </ResponseField>

            <ResponseField name="sections" type={<a href="/docs/api-reference/v3/reference/marketing/email-template-section">[EmailTemplateSection!]!</a>} required>
              The blocks that make up the email body, in order. Nested column children keep their own ids. A type this API version does not model field-by-field is returned as EmailTemplateUnknownSection.
            </ResponseField>

            <ResponseField name="sectionsJson" type={<a href="/docs/api-reference/v3/reference/common/json">[JSON!]!</a>} required>
              `sections` with every field selected, as JSON: one element per root block, in order, with `__typename` and nested column children. Empty or unreadable stored sections are \[]. Edits go through operations.
            </ResponseField>

            <ResponseField name="subject" type="String!" required>
              The subject line **as authored**, before per-recipient substitution. A subject containing `{{ }}` placeholders is filled in per customer at send time, and some sends prepend a prefix, so this is not necessarily the subject any one customer saw. Empty when the template has no subject of its own.
            </ResponseField>

            <ResponseField name="trigger" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-trigger">MarketingTrigger!</a>} required>
              The trigger context this template is valid for. Immutable after create. UNKNOWN when the stored trigger is not modeled in this API version.
            </ResponseField>

            <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
              When the template was last edited. Templates stay editable after the campaigns that used them have finished, so compare this against a campaign's `finishedAt` to tell whether the content here is still what that campaign actually sent.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="nodes" type={<a href="/docs/api-reference/v3/reference/marketing/email-template">[EmailTemplate!]!</a>} required>
      The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

      <Expandable title="fields" lazyRender>
        <ResponseField name="contentBackgroundColor" type="String!" required>
          The content canvas background, as set under Email styles in the email builder.
        </ResponseField>

        <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
          When the template was created.
        </ResponseField>

        <ResponseField name="emailBackgroundColor" type="String!" required>
          The email background, as set under Email styles in the email builder.
        </ResponseField>

        <ResponseField name="id" type="ID!" required>
          The id of this template.
        </ResponseField>

        <ResponseField name="legacyId" type="String!" required>
          The template's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
        </ResponseField>

        <ResponseField name="linkColor" type="String">
          The default link color, as set under Email styles in the email builder. Null when the merchant left it unset.
        </ResponseField>

        <ResponseField name="name" type="String!" required>
          The merchant-facing name of the template.
        </ResponseField>

        <ResponseField name="preview" type={<a href="/docs/api-reference/v3/reference/marketing/email-template-preview">EmailTemplatePreview</a>}>
          Render this template, to see what recipients get. Use a width of about 375 for a phone.

          **Requires:** [`marketing_templates_read`](/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

          <Expandable title="fields" lazyRender>
            **Arguments**

            <ResponseField name="eventId" type="ID">
              Render with this recent event's data instead of sample data: a 24-character hex event id. A well-formed id that can't be found falls back to sample data.
            </ResponseField>

            <ResponseField name="width" type="Int">
              Viewport width of the screenshot, 320-1200 pixels.
            </ResponseField>

            **Fields**

            <ResponseField name="height" type="Int">
              The screenshot's full height in pixels.
            </ResponseField>

            <ResponseField name="html" type="String!" required>
              The rendered email HTML, as a recipient's client would receive it.
            </ResponseField>

            <ResponseField name="imageUrl" type="String">
              A link to a full-length PNG screenshot at the requested width. It expires after an hour.
            </ResponseField>

            <ResponseField name="width" type="Int">
              The screenshot's width in pixels.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="previewText" type="String">
          The preview text shown after the subject in an inbox. Null when the merchant left it unset.
        </ResponseField>

        <ResponseField name="sections" type={<a href="/docs/api-reference/v3/reference/marketing/email-template-section">[EmailTemplateSection!]!</a>} required>
          The blocks that make up the email body, in order. Nested column children keep their own ids. A type this API version does not model field-by-field is returned as EmailTemplateUnknownSection.
        </ResponseField>

        <ResponseField name="sectionsJson" type={<a href="/docs/api-reference/v3/reference/common/json">[JSON!]!</a>} required>
          `sections` with every field selected, as JSON: one element per root block, in order, with `__typename` and nested column children. Empty or unreadable stored sections are \[]. Edits go through operations.
        </ResponseField>

        <ResponseField name="subject" type="String!" required>
          The subject line **as authored**, before per-recipient substitution. A subject containing `{{ }}` placeholders is filled in per customer at send time, and some sends prepend a prefix, so this is not necessarily the subject any one customer saw. Empty when the template has no subject of its own.
        </ResponseField>

        <ResponseField name="trigger" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-trigger">MarketingTrigger!</a>} required>
          The trigger context this template is valid for. Immutable after create. UNKNOWN when the stored trigger is not modeled in this API version.
        </ResponseField>

        <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
          When the template was last edited. Templates stay editable after the campaigns that used them have finished, so compare this against a campaign's `finishedAt` to tell whether the content here is still what that campaign actually sent.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pageInfo" type={<a href="/docs/api-reference/v3/pagination">PageInfo!</a>} required>
      Pagination metadata for the current page.

      <Expandable title="fields" lazyRender>
        <ResponseField name="endCursor" type="String">
          Cursor of the last edge in this page; pass to `after` to page forward.
        </ResponseField>

        <ResponseField name="hasNextPage" type="Boolean!" required>
          Whether more items exist after this page (drives forward pagination with `first`/`after`).
        </ResponseField>

        <ResponseField name="hasPreviousPage" type="Boolean!" required>
          Whether more items exist before this page (drives backward pagination with `last`/`before`).
        </ResponseField>

        <ResponseField name="startCursor" type="String">
          Cursor of the first edge in this page; pass to `before` to page backward.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
query {
  emailTemplates(after: "...", before: "...", first: 10, last: 10, orderBy: CREATED_AT, query: "...", reverse: true, trigger: ADDRESS_VERIFICATION_FAILED) {
    nodes {
      contentBackgroundColor
      createdAt
      emailBackgroundColor
      id
      legacyId
      linkColor
      name
      previewText
      # ...
    }
    pageInfo { hasNextPage endCursor }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.