Get a parsed email template

Fetch an email template with dynamic placeholders resolved for a specific card (or the raw template when no card is provided).

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 and, when providing a card, to read the card as well.
  3. Email template ID: Identify the email template to parse (required).
  4. Card UUID (optional): When provided, dynamic placeholders in the template are resolved using this card's data; when omitted, the template is returned without card-based parsing.

Step 1: Find Your Email Template ID and Card UUID

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

1. Via Pipefy UI

  • For the card: open the card in your browser; the card UUID can be obtained via a card query, using the card ID from the URL.

2. Via GraphQL Query

  • Use the card query to get a card's UUID:
{
  card(id: 10805973) {
    uuid
  }
}
  • 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 Parsed Email Template

Use the parsedEmailTemplate query to fetch an email template with dynamic fields parsed for a given card. Below is an example:

{
  parsedEmailTemplate(emailTemplateId: "12345", cardUuid: "550e8400-e29b-41d4-a716-446655440000") {
    id
    name
    subject
    body
    fromEmail
    fromName
    toEmail
    ccEmail
    bccEmail
    repoId
    defaultTemplate
    locale
    timeZone
    phaseFormLinkId
    hasInsecureContent
  }
}

Omit cardUuid to get the template without resolving placeholders:

{
  parsedEmailTemplate(emailTemplateId: "12345") {
    id
    name
    subject
    body
    fromEmail
    fromName
    toEmail
    ccEmail
    bccEmail
    repoId
    defaultTemplate
    hasInsecureContent
  }
}

Key Fields Explained:

  • id: Email template unique identifier.
  • name: Name of the template.
  • subject: Subject line (with placeholders resolved when a card is provided).
  • body: HTML body (with placeholders resolved when a card is provided).
  • 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": {
    "parsedEmailTemplate": {
      "id": "42",
      "name": "Follow-up",
      "subject": "Hello John, following up on your pizza order #100",
      "body": "<p>This is Jane from Acme Corp</p>",
      "fromEmail": "[email protected]",
      "fromName": "Jane from Acme Corp",
      "toEmail": "[email protected]",
      "ccEmail": "[email protected]",
      "bccEmail": "[email protected]",
      "repoId": "10805973",
      "defaultTemplate": false,
      "locale": null,
      "timeZone": null,
      "phaseFormLinkId": null,
      "hasInsecureContent": false
    }
  }
}

This query provides a quick and effective way to retrieve an email template with dynamic placeholders (e.g. {{card.title}}, {{phase123.field456}}) resolved for a specific card, or the raw template when no card is provided.