createEmailTemplate
Create a new email template record for transactional or marketing communications. Requires a unique internal name; subject and body can be added later.
Instructions
Create an email template - Create a new emailtemplate record. Writes live data.
Use when: adding a new transactional/marketing template. Rare - most BD email templates are built into the admin UI.
Required: email_name.
Pre-check before create: BD does NOT enforce uniqueness on email_name. Duplicates cause the wrong template to fire on transactional triggers. Do a server-side filter-find: listEmailTemplates property=email_name property_value=<proposed> property_operator==. Zero rows = name free; >=1 row = taken. Do NOT paginate unfiltered lists looking for the name - on sites with many templates that burns rate limit for nothing. If taken: reuse via updateEmailTemplate, OR ask the user, OR pick an alternate email_name and re-check. Never silently create a duplicate.
Enums: signature: 0/1; notemplate: default 2 (template + logo center); other values 0 (logo left), 3 (logo right), 4 (template, no logo), 1 (plaintext-only, no wrapper); category_id: default 0 (My Saved Templates) — 1/3/4/15/16 are system-populated, do NOT create under them; unsubscribe_link: 0/1.
Parameter interactions:
email_subjectandemail_bodycan use template tokens (e.g.%%%website_name%%%, recipient field tokens)email_bodysupports HTML
See also: updateEmailTemplate (modify existing).
On create: email_name is the only required field. Subject and body are optional at create time - you can create a template stub and fill in email_subject / email_body via updateEmailTemplate later. This lets you programmatically scaffold templates before customizing them via the admin UI.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| email_name | Yes | Internal name for this email template (used by `[email-template name=...]` references and admin lookups). **Lowercase, hyphens, no spaces** (e.g. `welcome-email`, `password-reset`, `lead-notification-admin`) — see **Rule: Email template recipe**. | |
| email_subject | No | Supports merge tags | |
| email_body | No | Content-only HTML — BD wraps it in the document scaffold. Open with any content tag (`<p>`, `<table>`, `<div>`, `<h1>`/`<h2>`, `<img>`, etc.). Inline `style=""` only — no `<style>` blocks (Outlook strips them) and no `class=""` (emails have no site stylesheet). Gradients need a fallback `background-color:` first. Verify image URLs return 200 before embedding when possible. Supports `%%%merge_tag%%%` tokens and `[widget=Name]` shortcodes. See **Rule: Email template recipe**. | |
| email_type | No | ||
| triggers | No | Comma-separated events | |
| website | No | 0=platform-wide | |
| email_from | No | ||
| priority | No | ||
| signature | No | Append the site's default email signature to this template. Default `0`. Set to `1` only when the user explicitly asks to include the site signature; BD appends it automatically at send time. | |
| category_id | No | Template category. On `create`: default to `0` (My Saved Templates); other values (`1`/`3`/`4`/`15`/`16`) are system-populated — do NOT create under them. `update` is unrestricted in any category. | |
| notemplate | No | Template + logo wrapper mode. `0` = template + logo left; `2` = template + logo center (default — use unless user specifies otherwise or it's a plaintext email); `3` = template + logo right; `4` = template, no logo; `1` = no template or logo (plaintext-only). When this is anything other than `1`, BD's global template already wraps `email_body` in a 600px-wide constraining table — do NOT add your own outer max-width wrapper in that case. | |
| content_type | No | ||
| unsubscribe_link | No |