# Create custom email template Creates an email template with custom structure, styles, and texts. You can add the variables for some texts to the template. To add the relevant texts for these variables, use the Send email based on template call. Endpoint: POST /projects/{project_id}/templates/email/{template_id}/{locale}/{template_type} Version: v1 Security: Server ## Path parameters: - `template_type` (string, required) type of template Enum: "custom", "password_reset", "account_confirmation", "email_confirmation", "welcome_email", "passwordless_auth_by_code", "passwordless_auth_by_code_link" - `project_id` (string, required) Login project ID from Publisher Account. - `template_id` (string, required) Name of the template. Can include latin characters, digits, characters “-” and “_”. - `locale` (string, required) Region of the texts that you provided in the template in the _ format, where: * language code: language code in the ISO 639-1 format; * country code: country/region code in the ISO 3166-1 alpha-2 format. ## Request fields (application/json): - `body` (string, required) Email content without opening and closing body tags. Example: "Hi {{first_name}} {{last_name}}!
We will be glad to see you on the {{site_link}} page." - `header` (string, required) Email subject. Example: "Welcome email" ## Response 200 fields (application/json): - `body` (string, required) Email content without opening and closing body tags. Example: "Hi {{first_name}} {{last_name}}!
We will be glad to see you on the {{site_link}} page." - `header` (string, required) Email subject. Example: "Welcome email" - `locale` (string, required) Region of the texts that you provided in the template in the _ format, where: * language code: language code in the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format; * country code: country/region code in the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. Example: "en_US" - `template_id` (string, required) Name of the template. Can include latin characters, digits, characters “-” and “_”. Example: "Welcome email template" - `template_type` (string, required) Example: "custom" ## Response 401 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 404 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 409 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 422 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information.