Email Templates

Override the subject, body, and CTA of Blue's transactional emails, and send a one-off test message to preview your copy.


White-label organizations can rewrite the copy of the transactional email Blue sends on their behalf. An email template is an EmailTemplate object, keyed to one EmailTemplateType per organization. You override the pieces you care about — subject line, body, call-to-action, footer — and Blue renders them in place of its defaults.

Today there is exactly one template type: INVITATION, the email a new member receives when invited to a workspace. The customization surface is intentionally narrow — this is not a general transactional-email engine, just an override for the invitation copy.

Use createEmailTemplate and updateEmailTemplate to manage the copy, sendTestEmail to preview it against sample data, and emailTemplate / emailTemplates to read it back. Branding email this way requires the company-level white_label feature for every write; the two read queries only require organization membership.

Create a template

Use the createEmailTemplate mutation to define the override for a template type. It takes the target organization (companyId) and the type, plus any of the copy fields you want to set. Omitted copy fields fall back to Blue’s defaults at render time.

mutation CreateEmailTemplate {
  createEmailTemplate(
    input: {
      companyId: "company_123"
      type: INVITATION
      enabled: true
      subject: "You've been invited to {{company}}"
      body: "{{name}}, join your team on {{company}} to start collaborating."
      ctaText: "Accept invitation"
      footer: "Sent by {{company}} via Blue."
    }
  ) {
    id
    type
    enabled
    subject
  }
}

The companyId argument accepts an organization ID or slug.

CreateEmailTemplateInput

ParameterTypeRequiredDescription
companyIdString!YesThe organization that owns the template. ID or slug.
typeEmailTemplateType!YesWhich transactional email to override. Only INVITATION is supported today.
enabledBooleanNoWhether the override is applied. When false, Blue uses its default copy.
subjectStringNoSubject line.
bodyStringNoMain body text.
ctaTextStringNoLabel of the call-to-action button.
ctaLinkStringNoURL the call-to-action button points at.
footerStringNoFooter line below the body.
disclaimerStringNoFine-print disclaimer line.
signatureStringNoSign-off line.

EmailTemplateType

ValueDescription
INVITATIONThe email sent when a new member is invited to a workspace. The only value.

Update a template

Use the updateEmailTemplate mutation to change the copy of an existing template. Identify it by id (the type is fixed at creation and cannot be changed here). Only the fields you pass are written.

mutation UpdateEmailTemplate {
  updateEmailTemplate(
    input: { id: "template_123", subject: "Your invitation to {{company}} is ready", enabled: true }
  ) {
    id
    subject
    enabled
    updatedAt
  }
}

UpdateEmailTemplateInput

ParameterTypeRequiredDescription
idString!YesThe EmailTemplate to update.
enabledBooleanNoWhether the override is applied.
nameStringNoInternal label for the template.
subjectStringNoSubject line.
bodyStringNoMain body text.
ctaTextStringNoLabel of the call-to-action button.
ctaLinkStringNoURL the call-to-action button points at.
footerStringNoFooter line below the body.
disclaimerStringNoFine-print disclaimer line.
signatureStringNoSign-off line.

Delete a template

Use the deleteEmailTemplate mutation to remove an override by id. Once deleted, the corresponding email reverts to Blue’s default copy. This mutation returns a bare Boolean (true on success), so it takes no sub-selection.

mutation DeleteEmailTemplate {
  deleteEmailTemplate(id: "template_123")
}
{ "data": { "deleteEmailTemplate": true } }

Send a test email

Use the sendTestEmail mutation to dispatch a one-off rendering of a template so you can preview your copy before it goes live. Blue renders the template with sample data — the recipient’s first name (falling back to "User"), their email, the organization’s name, and the name of the organization’s first workspace — then sends it as a real message to email. It returns Boolean (true once dispatched).

mutation SendTestEmail {
  sendTestEmail(input: { email: "[email protected]", emailTemplateId: "template_123" })
}
{ "data": { "sendTestEmail": true } }

SendTestEmailInput

ParameterTypeRequiredDescription
emailString!YesAddress to send the test message to.
emailTemplateIdString!YesThe EmailTemplate to render.
Test renders use placeholder data

The test email is built from sample values, not a live invitation: the recipient name comes from the Blue user that owns email (defaulting to "User" if that address has no account), and the company and project names are taken from the template’s organization and its first workspace. The message is tagged internally as a test send. Use it to check formatting and copy, not to validate a specific recipient’s real invitation.

Fetch a template by type

Use the emailTemplate query to read the single template configured for the context organization by type. The organization is taken from your X-Bloo-Company-ID header. Returns null if no override exists for that type. This query requires only organization membership — not the white_label feature.

query InvitationTemplate {
  emailTemplate(type: INVITATION) {
    id
    type
    enabled
    subject
    body
    ctaText
    ctaLink
    footer
  }
}
{
  "data": {
    "emailTemplate": {
      "id": "clm4n8qwx000008l0g4oxdqn7",
      "type": "INVITATION",
      "enabled": true,
      "subject": "You've been invited to {{company}}",
      "body": "{{name}}, join your team on {{company}} to start collaborating.",
      "ctaText": "Accept invitation",
      "ctaLink": null,
      "footer": "Sent by {{company}} via Blue."
    }
  }
}

List templates

Use the emailTemplates query to page through the templates for the context organization, optionally filtered by type. Like emailTemplate, it requires only organization membership.

query EmailTemplates {
  emailTemplates(filter: { type: INVITATION }, skip: 0, take: 20) {
    items {
      id
      type
      enabled
      subject
    }
    pageInfo {
      totalItems
      totalPages
      page
      perPage
      hasNextPage
      hasPreviousPage
    }
  }
}
{
  "data": {
    "emailTemplates": {
      "items": [
        {
          "id": "clm4n8qwx000008l0g4oxdqn7",
          "type": "INVITATION",
          "enabled": true,
          "subject": "You've been invited to {{company}}"
        }
      ],
      "pageInfo": {
        "totalItems": 1,
        "totalPages": 1,
        "page": 1,
        "perPage": 20,
        "hasNextPage": false,
        "hasPreviousPage": false
      }
    }
  }
}

Arguments

ArgumentTypeDefaultDescription
filterEmailTemplateFilterInputOptional filter. Set type to restrict to one template type.
skipInt0Number of items to skip.
takeInt20Number of items to return.

EmailTemplateFilterInput

FieldTypeDescription
typeEmailTemplateTypeRestrict results to one template type.

The EmailTemplate type

FieldTypeDescription
idID!Unique identifier.
uidString!Short public identifier.
typeEmailTemplateType!Which transactional email this overrides (INVITATION).
enabledBooleanWhether the override is applied. When false, Blue uses its default copy.
subjectStringSubject line.
bodyStringMain body text.
ctaTextStringLabel of the call-to-action button.
ctaLinkStringURL the call-to-action button points at.
footerStringFooter line below the body.
disclaimerStringFine-print disclaimer line.
signatureStringSign-off line.
createdAtDateTimeCreation timestamp.
updatedAtDateTimeLast-update timestamp.

The EmailTemplatePagination type returned by emailTemplates has the standard shape: items (a list of EmailTemplate) and pageInfo (a PageInfo).

Errors

CodeWhen
EMAIL_TEMPLATE_NOT_FOUNDupdateEmailTemplate, deleteEmailTemplate, or sendTestEmail references an id that does not exist.
PRO_REQUIREDA write was attempted on an organization without the white_label feature.
FORBIDDENThe caller is not an OWNER/ADMIN of the organization (writes), or not a member of it at all (reads).

Permissions

The two read queries and the four write operations have different access rules:

  • WritescreateEmailTemplate, updateEmailTemplate, deleteEmailTemplate, and sendTestEmail require that you are an OWNER or ADMIN of the organization and that the organization has the white_label feature. For update, delete, and sendTestEmail the organization is resolved from the template’s own id; for create it is the companyId you pass.
  • ReadsemailTemplate and emailTemplates require only that you are a member of the context organization (any CompanyUser row). They do not require white_label, so non-white-label members can inspect whether overrides exist.

White-label is bundled with the Pro plan — there is no standalone white-label SKU or subscription to manage through the API. Billing flows through the standard billing portal.