previewTemplate()
Overview
public struct function previewTemplate(
required string template
, boolean allowDrafts = false
, numeric version = 0
, string previewRecipient = ""
, boolean useDefaultContent = false
)
Prepares an email message ready for preview (returns a struct with subject, htmlBody + textBody keys)
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| template | string | Yes | The ID of the template to send |
| allowDrafts | boolean | No (default=false) | Whether or not to allow draft versions of the template |
| version | numeric | No (default=0) | A specific version number to preview (default is latest) |
| previewRecipient | string | No (default="") | Optional ID of a recipient whose preview parameters we will fetch and whose context data to use when rendering the email content |
| useDefaultContent | boolean | No (default=false) |