MailSlurpAPI.Api.TemplateController (mailslurp v15.13.9)

API calls for all endpoints tagged TemplateController.

Link to this section Summary

Functions

Create a Template Create an email template with variables for use with templated transactional emails.

Delete email template Delete template

List templates Get all templates in paginated format

Get template Get email template

Get template preview HTML Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.

Get template preview Json Get email template preview with passed template variables in JSON format. Pass template variables as query params.

List templates Get all templates

Link to this section Functions

Link to this function

create_template(connection, create_template_options, opts \\ [])

Create a Template Create an email template with variables for use with templated transactional emails.

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • create_template_options (CreateTemplateOptions):
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

} on success {:error, info} on failure

Link to this function

delete_template(connection, template_id, opts \\ [])

@spec delete_template(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete email template Delete template

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • template_id (String.t): Template ID
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

} on success {:error, info} on failure

Link to this function

get_all_templates(connection, opts \\ [])

@spec get_all_templates(Tesla.Env.client(), keyword()) ::
  {:ok, MailSlurpAPI.Model.PageTemplateProjection.t()} | {:error, Tesla.Env.t()}

List templates Get all templates in paginated format

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :page (integer()): Optional page index in list pagination
    • :size (integer()): Optional page size in list pagination
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp

returns

Returns

} on success {:error, info} on failure

Link to this function

get_template(connection, template_id, opts \\ [])

@spec get_template(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.TemplateDto.t()} | {:error, Tesla.Env.t()}

Get template Get email template

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • template_id (String.t): Template ID
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

} on success {:error, info} on failure

Link to this function

get_template_preview_html(connection, template_id, opts \\ [])

@spec get_template_preview_html(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, Tesla.Env.t()}

Get template preview HTML Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • template_id (String.t): Template ID
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

} on success {:error, info} on failure

Link to this function

get_template_preview_json(connection, template_id, opts \\ [])

@spec get_template_preview_json(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.TemplatePreview.t()} | {:error, Tesla.Env.t()}

Get template preview Json Get email template preview with passed template variables in JSON format. Pass template variables as query params.

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • template_id (String.t): Template ID
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

} on success {:error, info} on failure

Link to this function

get_templates(connection, opts \\ [])

@spec get_templates(Tesla.Env.client(), keyword()) ::
  {:ok, [MailSlurpAPI.Model.TemplateProjection.t()]} | {:error, Tesla.Env.t()}

List templates Get all templates

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

, ...]} on success {:error, info} on failure

Link to this function

update_template(connection, template_id, create_template_options, opts \\ [])

Update template Update email template

parameters

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • template_id (String.t): Template ID
  • create_template_options (CreateTemplateOptions):
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

} on success {:error, info} on failure