(Templates)
Preview- Preview changes to a template⚠️ Deprecated
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.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
using Clerk.BackendAPI.Models.Operations;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Templates.PreviewAsync(
templateType: "email",
slug: "welcome-email",
requestBody: new PreviewTemplateRequestBody() {
Subject = "Welcome to our service!",
Body = "Hi, thank you for joining our service.",
FromEmailName = "hello",
ReplyToEmailName = "support",
}
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TemplateType |
string | ✔️ | The type of template to preview | |
Slug |
string | ✔️ | The slug of the template to preview | welcome-email |
RequestBody |
PreviewTemplateRequestBody | ➖ | Required parameters |
Error Type | Status Code | Content Type |
---|---|---|
Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 422 | application/json |
Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |