Warning
This SDK is DEPRECATED
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.
require 'clerk_sdk_ruby'
Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.templates.preview(template_type: 'email', slug: 'welcome-email', body: Models::Operations::PreviewTemplateRequestBody.new(
subject: 'Welcome to our service!',
body: 'Hi, thank you for joining our service.',
from_email_name: 'hello',
reply_to_email_name: 'support'
))
unless res.object.nil?
# handle response
end| Parameter | Type | Required | Description |
|---|---|---|---|
template_type |
::String | ✔️ | The type of template to preview |
slug |
::String | ✔️ | The slug of the template to preview |
body |
Crystalline::Nilable.new(Models::Operations::PreviewTemplateRequestBody) | ➖ | Required parameters |
Crystalline::Nilable.new(Models::Operations::PreviewTemplateResponse)
| Error Type | Status Code | Content Type |
|---|---|---|
| Models::Errors::ClerkErrors | 400, 401, 404, 422 | application/json |
| Errors::APIError | 4XX, 5XX | */* |