Skip to main content

Email templates

The content of each e-mail the platform sends (portal invitation, API key expiring...). duplicate copies a template as a draft, init-defaults create restores the default templates (overwriting yours), and preview get / preview create render a template without sending anything.

CommandHTTPDescription
email-templates listGET /v1/email_templatesList email templates
email-templates createPOST /v1/email_templatesCreate email template
email-templates getGET /v1/email_templates/{id}Get email template
email-templates updatePATCH /v1/email_templates/{id}Update email template
email-templates deleteDELETE /v1/email_templates/{id}Delete email template
email-templates duplicatePOST /v1/email_templates/{id}/duplicateDuplicate email template
email-templates init-defaults createPOST /v1/email_templates/init_defaultsReset templates to defaults
email-templates preview getGET /v1/email_templates/{id}/previewPreview email template
email-templates preview createPOST /v1/email_templates/{id}/previewRender template with variables

Examples​

--params carries query, path and header parameters (id, page, filters, X-Workspace-Id); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# List email templates
kobana dashboards email-templates list --fields "id,name,type,is_active"

# Preview email template
kobana dashboards email-templates preview get --params '{"id": "TEMPLATE_ID"}'

# Render template with variables
kobana dashboards email-templates preview create \
--params '{"id": "TEMPLATE_ID"}' \
--json '{"variables": {"name": "Ana"}}'

# Duplicate email template
kobana dashboards email-templates duplicate \
--params '{"id": "TEMPLATE_ID"}' \
--json '{"new_name": "Convite (versão B)"}'

Next steps​