Skip to content

\TemplateControllerApi

All URIs are relative to https://api.mailslurp.com

Method HTTP request Description
create_template post /templates Create a Template
delete_template delete /templates/{templateId} Delete email template
get_all_templates get /templates/paginated List templates
get_template get /templates/{templateId} Get template
get_template_preview_html get /templates/{templateId}/preview/html Get template preview HTML
get_template_preview_json get /templates/{templateId}/preview/json Get template preview Json
get_templates get /templates List templates
update_template put /templates/{templateId} Update template

create_template

crate::models::TemplateDto create_template(create_template_options) Create a Template

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

Parameters

Name Type Description Required Notes
create_template_options CreateTemplateOptions [required]

Return type

crate::models::TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

delete_template

delete_template(template_id) Delete email template

Delete template

Parameters

Name Type Description Required Notes
template_id String Template ID [required]

Return type

(empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to ]

get_all_templates

crate::models::PageTemplateProjection get_all_templates(page, size, sort, since, before) List templates

Get all templates in paginated format

Parameters

Name Type Description Required Notes
page Option<i32> Optional page in list pagination [default to 0]
size Option<i32> Optional page size in list pagination [default to 20]
sort Option<String> Optional createdAt sort direction ASC or DESC [default to ASC]
since Option<String> Filter by created at after the given timestamp
before Option<String> Filter by created at before the given timestamp

Return type

crate::models::PageTemplateProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

get_template

crate::models::TemplateDto get_template(template_id) Get template

Get email template

Parameters

Name Type Description Required Notes
template_id String Template ID [required]

Return type

crate::models::TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

get_template_preview_html

String get_template_preview_html(template_id) Get template preview HTML

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

Parameters

Name Type Description Required Notes
template_id String Template ID [required]

Return type

String

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/html;charset=utf-8, text/html

[Back to top] [Back to API list] [Back to Model list] [Back to ]

get_template_preview_json

crate::models::TemplatePreview get_template_preview_json(template_id) Get template preview Json

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

Parameters

Name Type Description Required Notes
template_id String Template ID [required]

Return type

crate::models::TemplatePreview

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

get_templates

Vec get_templates() List templates

Get all templates

Parameters

This endpoint does not need any parameter.

Return type

Vec

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

update_template

crate::models::TemplateDto update_template(template_id, create_template_options) Update template

Update email template

Parameters

Name Type Description Required Notes
template_id String Template ID [required]
create_template_options CreateTemplateOptions [required]

Return type

crate::models::TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]