template()

Usage

template(name, locale, source)

Description
Loads a node of type MailTemplate with the given name and locale values and uses the given source entity to resolve template expressions in the content field of the loaded node, returning the resulting text.

Example

${template('MAIL_SUBJECT', 'de', me)}

with the MailTemplate content

Welcome, ${this.name}!

results in

Welcome, admin!

Note
This function is quite similar to the replace() function which serves a similar purpose but works on any string rather than on a mail template.

About this article
Last change 2019-03-16
Topics FrontendFunctionsStructr 2.0