Clerk.Template (Clerk SDK v1.0.1)
Email & SMS templates allow you to customize the theming and wording of emails & SMS messages that are sent by your instance.
Summary
Functions
Returns the details of a template
Returns a list of all templates. The templates are returned sorted by position.
Returns a preview of a template for a given template_type, slug and body
Reverts an updated template to its default state
Toggles the delivery of a template for a given template_type and slug
Updates the existing template of the given type and slug
Functions
get(template_type, id, opts \\ [])
Returns the details of a template
list(template_type, opts \\ [])
Returns a list of all templates. The templates are returned sorted by position.
template_type required string The type of templates to list (email or SMS)
Enum: "email" "sms"
preview(template_type, id, params, opts \\ [])
Returns a preview of a template for a given template_type, slug and body
REQUEST BODY SCHEMA: application/json
Required parameters
subject
string or null The email subject. Applicable only to email templates.
body
string The template body before variable interpolation
from_email_name
string The local part of the From email address that will be used for emails. For example, in the address 'hello@example.com', the local part is 'hello'. Applicable only to email templates.
revert(template_type, id, opts \\ [])
Reverts an updated template to its default state
toggle_delivery(template_type, id, params, opts \\ [])
Toggles the delivery of a template for a given template_type and slug
REQUEST BODY SCHEMA: application/json
delivered_by_clerk
boolean or null Whether Clerk should deliver emails or SMS messages based on the current template
update(template_type, id, params, opts \\ [])
Updates the existing template of the given type and slug
REQUEST BODY SCHEMA: application/json
name
string The user-friendly name of the template
subject
string or null The email subject. Applicable only to email templates.
markup
string or null The editor markup used to generate the body of the template
body
string The template body before variable interpolation
delivered_by_clerk
boolean or null Whether Clerk should deliver emails or SMS messages based on the current template
from_email_name
string The local part of the From email address that will be used for emails. For example, in the address 'hello@example.com', the local part is 'hello'. Applicable only to email templates.