Skip to main content

kobana dashboards email-templates

Commands of kobana dashboards email-templates. Every global option (Global options) applies here.

CommandHTTPDescription
email-templates previewGET /v1/email_templates/{id}/previewPreview email template
email-templates preview createPOST /v1/email_templates/{id}/previewRender template with variables
email-templates listGET /v1/email_templatesList email templates
email-templates createPOST /v1/email_templatesCreate email template
email-templates init-defaultsPOST /v1/email_templates/init_defaultsReset templates to defaults
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 preview​

Preview email template

kobana dashboards email-templates preview [ID] [OPTIONS] [COMMAND]

GET /v1/email_templates/{id}/preview

Renders the template with sample data, inside the organization's layout. Nothing is sent.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Responses

HTTPDescription
200The rendered email.
404Resource not found in the current organization.

email-templates preview create​

Render template with variables

kobana dashboards email-templates preview create [ID] [OPTIONS]

POST /v1/email_templates/{id}/preview

Renders the template with the variables sent, without a layout. Nothing is sent.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Request body

NameTypeRequiredDescription
variablesobjectnoValues for the template {{name}} variables.

More fields and nested objects: kobana schema dashboards.email-templates.preview.create.

Responses

HTTPDescription
200The rendered email.
400Invalid request (missing required field, invalid type or variables).
404Resource not found in the current organization.

email-templates list​

List email templates

kobana dashboards email-templates list [OPTIONS]

GET /v1/email_templates

Lists the organization's own email templates, ordered by type and name. Returns the whole set, unpaginated.

Query parameters

NameTypeRequiredDescription
typestringnoOnly templates of this notification type. Values: api_key_expiring, account_suspended, account_activated, portal_invitation, portal_signup_verification, magic_link_portal, magic_link_dashboard, email_verification, password_reset, welcome, email_change_verification, password_verification, account_invitation, organization_welcome, dashboard_user_welcome.
is_activestringnotrue for the active templates, false for the drafts. Values: true, false.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Responses

HTTPDescription
200The organization's templates.
404Resource not found in the current organization.
422Request body failed validation.

email-templates create​

Create email template

kobana dashboards email-templates create [OPTIONS]

POST /v1/email_templates

Creates a template for a notification type. It is a draft unless is_active is true — then the previous active template of the type becomes a draft.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Request body

NameTypeRequiredDescription
namestringyesTemplate name (required on create).
typestringyesNotification type the template renders (required). Values: api_key_expiring, account_suspended, account_activated, portal_invitation, portal_signup_verification, magic_link_portal, magic_link_dashboard, email_verification, password_reset, welcome, email_change_verification, password_verification, account_invitation, organization_welcome, dashboard_user_welcome.
subjectstringyesEmail subject, with {{name}} variables (required on create).
html_bodystringyesHTML body, with {{name}} variables (required on create).
text_bodystringnoPlain-text alternative body. null clears it.
bccanyOfnoList (or a single address) of BCC emails. Invalid addresses return 422; omitted on update, the current list is kept.
variablesarray<string>noNames of the variables the template uses.
is_activebooleannoMakes this the active template of its type; the previous active one becomes a draft. Defaults to false on create.

More fields and nested objects: kobana schema dashboards.email-templates.create.

Responses

HTTPDescription
201Template created.
400Invalid request (missing required field, invalid type or variables).
404Resource not found in the current organization.
422Request body failed validation.

email-templates init-defaults​

Reset templates to defaults

kobana dashboards email-templates init-defaults [OPTIONS]

POST /v1/email_templates/init_defaults

Creates or resets the template of every notification type to the shipped default and activates it. Overwrites the content of the organization's existing templates.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Responses

HTTPDescription
200One row per notification type.
404Resource not found in the current organization.

email-templates get​

Get email template

kobana dashboards email-templates get [ID] [OPTIONS]

GET /v1/email_templates/{id}

Returns a template of the organization or a platform default.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Responses

HTTPDescription
200The template.
404Resource not found in the current organization.

email-templates update​

Update email template

kobana dashboards email-templates update [ID] [OPTIONS]

PATCH /v1/email_templates/{id}

Updates a template of the organization. Only the fields sent change. Platform defaults cannot be changed (404).

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Request body

NameTypeRequiredDescription
namestringnoTemplate name (required on create).
subjectstringnoEmail subject, with {{name}} variables (required on create).
html_bodystringnoHTML body, with {{name}} variables (required on create).
text_bodystringnoPlain-text alternative body. null clears it.
bccanyOfnoList (or a single address) of BCC emails. Invalid addresses return 422; omitted on update, the current list is kept.
variablesarray<string>noNames of the variables the template uses.
is_activebooleannoMakes this the active template of its type; the previous active one becomes a draft. Defaults to false on create.
public_idstring (uuid)noNew public identifier (UUID), when the organization allows choosing it.

More fields and nested objects: kobana schema dashboards.email-templates.update.

Responses

HTTPDescription
200Template updated.
400Invalid request (missing required field, invalid type or variables).
404Resource not found in the current organization.
409The public_id sent is already in use.
422Request body failed validation.

email-templates delete​

Delete email template

kobana dashboards email-templates delete [ID] [OPTIONS]

DELETE /v1/email_templates/{id}

Permanently deletes an inactive template of the organization. The active template of a type cannot be deleted (422): activate another one first.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Responses

HTTPDescription
200Template deleted.
404Resource not found in the current organization.
422Request body failed validation.

email-templates duplicate​

Duplicate email template

kobana dashboards email-templates duplicate [ID] [OPTIONS]

POST /v1/email_templates/{id}/duplicate

Copies a template as an inactive draft.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on: the id or the public_id shown under Workspaces on the dashboard. Inside the token's organization, data lives in workspaces. It may be omitted while the organization has a single workspace; with two or more, leaving it out returns 400 workspace_required. A workspace outside the organization returns 403 unknown_workspace. With a person token, only the workspaces that person has access to are reachable (organization owners reach all of them); any other returns 403 workspace_access_denied.

Request body

NameTypeRequiredDescription
new_namestringnoName of the copy. Default: "<name> (Cópia)".

More fields and nested objects: kobana schema dashboards.email-templates.duplicate.

Responses

HTTPDescription
201The copy created.
400Invalid request (missing required field, invalid type or variables).
404Resource not found in the current organization.