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

NameTypeRequiredDescription
templatestringYesThe ID of the template to send
argsstructYesStructure of args to provide email specific information about the send (i.e. userId of web user to send to, etc.)
recipientIdstringNo (default="")ID of the recipient to send the email to
toarrayNoOptional array of addresses to send the email to (leave empty should the recipient type for the template be able to calculate this for you)
ccarrayNoOptional array of addresses to cc in to the email
bccarrayNoOptional array of addresses to bcc in to the email
parametersstructNoOptional struct of variables for use in content token substitution in subject and body
attachmentsarrayNo
messageHeadersstructNoOptional struct of email message headers to set
isTestbooleanNo (default=false)Whether or not this is for a test send
isPreviewbooleanNo (default=false)
versionnumericNo (default=0)
useDefaultContentbooleanNo (default=false)
layoutstringNo (default="")
customLayoutstringNo (default="")