In MailService we are able to set body token and use these values on the view (content of email body). Currently the only values that can be set on the body tokens are simple, i.e. not array, structs, etc.
My question: Is it possible to assign a complex value to the body token, e.g. an array, struct, rc collection and use them on the view that render the email body content?
Here’s an example to illustrate:
In a handler method that handles the email send out:
local.email.setBodyTokens({
stInfo = stReportInfo
}
In the view (for email body content):
loop through @stInfo@??
I know the answer is most likely ‘no’, but I want to check to see if it’s possible. Thanks.
You can do this, but not with the tokens. Create a view for the E-mail body and use renderView() to generate the view. Pass in the bits you need directly via view args so you don’t pollute you rc or prc. Then set the returned HTML directly into the E-mail.
Here you can see something similar going on in ContentBox CMS.