Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 9.47 KB

README.md

File metadata and controls

53 lines (36 loc) · 9.47 KB

Templates

(templates)

Overview

Available Operations

  • preview - Preview changes to a template ⚠️ Deprecated

preview

Returns a preview of a template for a given template_type, slug and body

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

Example Usage

from clerk_backend_api import Clerk

with Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    res = s.templates.preview(template_type="email", slug="welcome-email", subject="Welcome to our service!", body="Hi, thank you for joining our service.", 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 str ✔️ The type of template to preview email
slug str ✔️ The slug of the template to preview welcome-email
subject OptionalNullable[str] The email subject.
Applicable only to email templates.
Welcome to our service!
body Optional[str] The template body before variable interpolation Hi, thank you for joining our service.
from_email_name Optional[str] The local part of the From email address that will be used for emails.
For example, in the address '[email protected]', 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 '[email protected]', 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.PreviewTemplateResponseBody

Errors

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