(EmailSmsTemplates)
List- List all templates⚠️ DeprecatedGet- Retrieve a template⚠️ DeprecatedToggleDelivery- Toggle the delivery by Clerk for a template of a given type and slug⚠️ Deprecated
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.
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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TemplateType |
TemplateType | ✔️ | The type of templates to list (email or SMS) |
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Returns the details of a template
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TemplateType |
PathParamTemplateType | ✔️ | The type of templates to retrieve (email or SMS) | |
Slug |
string | ✔️ | The slug (i.e. machine-friendly name) of the template to retrieve | welcome-email |
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
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.
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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TemplateType |
ToggleTemplateDeliveryPathParamTemplateType | ✔️ | The type of template to toggle delivery for | |
Slug |
string | ✔️ | The slug of the template for which to toggle delivery | welcome-email |
RequestBody |
ToggleTemplateDeliveryRequestBody | ➖ | N/A |
ToggleTemplateDeliveryResponse
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |