Skip to content

Latest commit

 

History

History
136 lines (91 loc) · 9.62 KB

File metadata and controls

136 lines (91 loc) · 9.62 KB

EmailSmsTemplates

(EmailSmsTemplates)

Overview

Available Operations

  • List - List all templates ⚠️ Deprecated
  • Get - Retrieve a template ⚠️ Deprecated
  • ToggleDelivery - Toggle the delivery by Clerk for a template of a given type and slug ⚠️ Deprecated

List

Returns a list of all templates. The templates are returned sorted by position.

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

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.EmailSmsTemplates.ListAsync(templateType: Clerk.BackendAPI.Models.Operations.TemplateType.Email);

// handle response

Parameters

Parameter Type Required Description Example
TemplateType TemplateType ✔️ The type of templates to list (email or SMS) email

Response

GetTemplateListResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 422 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Get

Returns the details of a template

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

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.EmailSmsTemplates.GetAsync(
    templateType: Clerk.BackendAPI.Models.Operations.PathParamTemplateType.Email,
    slug: "welcome-email"
);

// handle response

Parameters

Parameter Type Required Description Example
TemplateType PathParamTemplateType ✔️ The type of templates to retrieve (email or SMS) email
Slug string ✔️ The slug (i.e. machine-friendly name) of the template to retrieve welcome-email

Response

GetTemplateResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

ToggleDelivery

Toggles the delivery by Clerk for a template of a given type and slug. If disabled, Clerk will not deliver the resulting email or SMS. The app developer will need to listen to the email.created or sms.created webhooks in order to handle delivery themselves.

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

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.EmailSmsTemplates.ToggleDeliveryAsync(
    templateType: Clerk.BackendAPI.Models.Operations.ToggleTemplateDeliveryPathParamTemplateType.Email,
    slug: "welcome-email",
    requestBody: new ToggleTemplateDeliveryRequestBody() {
        DeliveredByClerk = true,
    }
);

// handle response

Parameters

Parameter Type Required Description Example
TemplateType ToggleTemplateDeliveryPathParamTemplateType ✔️ The type of template to toggle delivery for email
Slug string ✔️ The slug of the template for which to toggle delivery welcome-email
RequestBody ToggleTemplateDeliveryRequestBody N/A

Response

ToggleTemplateDeliveryResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*