prepareMessage()
Overview
public struct function prepareMessage(
required string template
, required struct args
, string recipientId = ""
, array to
, array cc
, array bcc
, struct parameters
, array attachments
, struct messageHeaders
, boolean isTest = false
, boolean isPreview = false
, numeric version = 0
, boolean useDefaultContent = false
, string layout = ""
, string customLayout = ""
)
Prepares an email message ready for sending (returns a struct with information about the message)
Arguments
Name | Type | Required | Description |
---|---|---|---|
template | string | Yes | The ID of the template to send |
args | struct | Yes | Structure of args to provide email specific information about the send (i.e. userId of web user to send to, etc.) |
recipientId | string | No (default="") | ID of the recipient to send the email to |
to | array | No | Optional array of addresses to send the email to (leave empty should the recipient type for the template be able to calculate this for you) |
cc | array | No | Optional array of addresses to cc in to the email |
bcc | array | No | Optional array of addresses to bcc in to the email |
parameters | struct | No | Optional struct of variables for use in content token substitution in subject and body |
attachments | array | No | |
messageHeaders | struct | No | Optional struct of email message headers to set |
isTest | boolean | No (default=false) | Whether or not this is for a test send |
isPreview | boolean | No (default=false) | |
version | numeric | No (default=0) | |
useDefaultContent | boolean | No (default=false) | |
layout | string | No (default="") | |
customLayout | string | No (default="") |