Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 12.5 KB

File metadata and controls

57 lines (40 loc) · 12.5 KB

EmailAndSmsTemplates

(email_and_sms_templates)

Overview

Available Operations

  • upsert - Update a template for a given type and slug ⚠️ Deprecated

upsert

Updates the existing template of the given type and slug

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

import clerk_backend_api
from clerk_backend_api import Clerk

with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    res = s.email_and_sms_templates.upsert(template_type=clerk_backend_api.UpsertTemplatePathParamTemplateType.SMS, slug="verification-code", name="Verification Code", subject="Your Verification Code", markup="<p>Your code: {{code}}</p>", body="Use this code to verify your email: {{code}}", delivered_by_clerk=True, from_email_name="hello", reply_to_email_name="support")

    if res is not None:
        # handle response
        pass

Parameters

Parameter Type Required Description Example
template_type models.UpsertTemplatePathParamTemplateType ✔️ The type of template to update sms
slug str ✔️ The slug of the template to update verification-code
name Optional[str] The user-friendly name of the template Verification Code
subject OptionalNullable[str] The email subject.
Applicable only to email templates.
Your Verification Code
markup OptionalNullable[str] The editor markup used to generate the body of the template

Your code: {{code}}

body Optional[str] The template body before variable interpolation Use this code to verify your email: {{code}}
delivered_by_clerk OptionalNullable[bool] Whether Clerk should deliver emails or SMS messages based on the current template true
from_email_name Optional[str] The local part of the From email address that will be used for emails.
For example, in the address 'hello@example.com', the local part is 'hello'.
Applicable only to email templates.
hello
reply_to_email_name Optional[str] The local part of the Reply To email address that will be used for emails.
For example, in the address 'hello@example.com', the local part is 'hello'.
Applicable only to email templates.
support
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Template

Errors

Error Type Status Code Content Type
models.ClerkErrors 400, 401, 402, 403, 404, 422 application/json
models.SDKError 4XX, 5XX */*