Why use templates
Reusability
Write your email HTML once and reuse it across API sends, workflow steps, and campaigns. Updates to the template apply everywhere it is used.
Variable substitution
Use
{{variable}} placeholders in the subject and body. Plunk resolves them from contact data at send time.Consistent branding
Manage all email designs in one place. Teams can review and update templates without changing application code.
Type-based delivery rules
The template type (transactional vs. marketing) determines whether unsubscribed contacts can receive the email — independent of how it is sent.
Creating a template
Set the template details
- Name — internal label, not shown to recipients
- Description — optional notes
- Type —
TRANSACTIONALorMARKETING(see Template types below)
Configure the sender
- From — must be from a verified domain in your project
- From name — optional display name shown in the recipient’s inbox
- Reply-to — optional reply address
Write the content
- Subject — the email subject line; supports
{{variable}}placeholders - Body — HTML email content; use the built-in editor or paste your own HTML
Template types
Templates have one of two types. Choose based on whether the email is an action-triggered notification or a marketing communication.| Type | Unsubscribe footer | Sent to unsubscribed contacts? | Use for |
|---|---|---|---|
TRANSACTIONAL | Not included | Yes — always delivered | Password resets, invoices, account alerts, receipts |
MARKETING | Automatically included (Plunk-hosted unsubscribe page) | No — unsubscribed contacts are skipped | Newsletters, announcements, promotions |
Variable substitution
Use{{variableName}} in the subject or body to insert dynamic values. Plunk resolves variables from the contact’s data at send time.
Always-available variables
These variables are available in every template, regardless of custom contact data:| Variable | Description |
|---|---|
{{id}} | The contact’s unique identifier |
{{email}} | The contact’s email address |
{{unsubscribeUrl}} | URL to the Plunk-hosted unsubscribe page |
{{subscribeUrl}} | URL to the Plunk-hosted subscribe / re-subscribe page |
{{manageUrl}} | URL to the Plunk-hosted preferences management page |
Special fields
These fields are reserved by Plunk but can be used in templates:| Variable | Description |
|---|---|
{{subscribed}} | The contact’s subscription state (true or false) |
{{locale}} | The contact’s preferred locale (e.g., "en", "fr") |
Fallback values
Use{{variable ?? 'fallback'}} to provide a default when a variable is not set:
firstName is not set on the contact, this renders as Hi there,.
Passing data at send time
When sending viaPOST /v1/send, pass a data object to supply or override variable values:
- Persistent values (plain key-value pairs) are saved to the contact record and used for future emails.
- Non-persistent values (
{ "value": "...", "persistent": false }) are used only for this send and not saved.
Using templates in transactional emails
Pass the template ID in thetemplate field of POST /v1/send. Fields provided in the request body (such as subject or from) override the template’s stored values.
Using templates in workflows
In the Send Email step of a workflow, select a template from the dropdown. The contact’s data — along with event context from the workflow execution — is available for variable substitution.The template’s type controls delivery. A marketing template in a workflow step will not be sent to an unsubscribed contact. Use a transactional template for steps that must always deliver.
Using templates in campaigns
When creating a campaign, you can base the email content on a saved template. Select the template in the campaign editor; the subject and body are pre-filled from the template and can be edited before sending.Campaigns are always sent only to subscribed contacts, regardless of template type.