getMailHeader

The getMailHeader function returns the subject for the email message that is sent for a specific record. This function takes the following arguments:

Argument Required Description
templateName Yes Specifies the name of the HTML template.
$RECORD Yes

Specifies the record that triggers the email notification. This record contains data that is used to construct the email message.

Example: $L.file

$RECORDOLD Yes

Specifies the pre-update version of the record that triggers the email notification. This record contains data that is used to construct the email message.

Example: $L.file.save

recipient No

This argument is reserved.

The email message will always be sent to the recipient defined in the notification record.

lang No

Specifies the language code of a specific language version of the HTML template. This argument is typically used if you always send this notification in a certain language.

If this argument is not specified, Service Manager takes the recipient's default language when determining which language version of the HTML template to use. For each recipient, Service Manager detects:

  • The language setting in the recipient's contact record. If this does not exist, then
  • The language setting in the recipient's operator record. If this does not exist, then
  • The system default language.

If the recipient is a distribution group and all its members have the same default language, the common default language is used. If the members of that distribution have different default languages, the system default language is used.

Example: de

The Arguments field in the notification record takes only RAD expressions. Therefore, the expression must use a jscall function to call the getMailHeader function in the ScriptLibrary. A typical expression resembles the following:

jscall("HTMLTemplates.getMailHeader", "SM Add", $L.file, $L.file.save)