Get an email template by ID

Fetch a single email template by its ID (raw template, no placeholder parsing).

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: You must have permission to read the email template.
  3. Email template ID: Identify the email template to retrieve.

Step 1: Find Your Email Template ID

See our Get resource IDs page for how to find IDs.

  • Use the emailTemplates query to list templates for a repo and find the template ID:
{
  emailTemplates(repoId: "10805973") {
    edges {
      node {
        id
        name
      }
    }
  }
}

Step 2: Query Email Template

Use the emailTemplate query to retrieve a single email template by its ID. Below is an example:

{
  emailTemplate(id: "12345") {
    id
    name
    subject
    body
    fromEmail
    fromName
    toEmail
    ccEmail
    bccEmail
    repoId
    defaultTemplate
    locale
    timeZone
    phaseFormLinkId
    hasInsecureContent
  }
}

Key Fields Explained:

  • id: Email template unique identifier.
  • name: Name of the template.
  • subject: Subject line (may contain placeholders like {{card.title}}).
  • body: HTML body (may contain placeholders).
  • fromEmail: Sender email address.
  • fromName: Sender display name.
  • toEmail: To addresses.
  • ccEmail: CC addresses.
  • bccEmail: BCC addresses.
  • repoId: ID of the pipe/table where the template resides.
  • defaultTemplate: Whether this is the default template.
  • locale: Locale used to format dynamic field values.
  • timeZone: Time zone used to format dynamic field values.
  • phaseFormLinkId: Phase form link ID.
  • hasInsecureContent: Whether the template body contains insecure content.

Step 3: Execute and Interpret the Response

After running the query, you'll receive a structured JSON response. Here's an example:

{
  "data": {
    "emailTemplate": {
      "id": "42",
      "name": "Follow-up",
      "subject": "Hello {{phase1.field2}}, following up on your {{card.title}}",
      "body": "<p>This is {{sent_by.name}} from {{organization.name}}</p>",
      "fromEmail": "[email protected]",
      "fromName": "Support",
      "toEmail": "{{phase1.field3}}",
      "ccEmail": null,
      "bccEmail": null,
      "repoId": "10805973",
      "defaultTemplate": false,
      "locale": null,
      "timeZone": null,
      "phaseFormLinkId": null,
      "hasInsecureContent": false
    }
  }
}

This query returns the template as stored (with placeholders unresolved). To get the same template with placeholders resolved for a specific card, use the parsed email template query.