Retaining HTML formatting when using expressions and meta tags

EmailPlus manipulates all output from meta tags, expressions, and custom meta tags so that formatting is retained in HTML email messages. The output of HTML EmailPlusTemplates that is generated in EmailPlus 2.1 might differ from that of EmailPlus 2.0. Plain text email templates are not affected.

The EMP_Verbatim function and EMP_EscapeHTML function provide more control over the output from expressions and custom meta tags. These functions can be called in an EmailPlusTemplate expression, or included in your custom schema code for custom meta tags.

Attention: As you work with EmailPlus expressions and meta tags, note that $entity is a special Perl variable in HCL Compass. This variable refers to the current entity that is being processed. If you use $entity in an EmailPlusTemplate or an EmailPlusRule expression, the $entity variable in your expression will refer to the record type that you are currently modifying. If you make a call to $entity->GetFieldValue($fieldName)->GetValue() and $fieldName is the name of a field that does not exist in your current EmailPlusTemplate or EmailPlusRule record, then the expression will not be evaluated correctly. To remedy this problem, the EmailPlus functions Gfv() and Gfov() return the value of fields from the record the EmailPlusRule relates to, even if the fields do not exist on the current record. See EmailPlus global script functions for more information about the Gfv()function and the Gfov().
Gfv($fieldName)
This function is the equivalent of calling $entity->GetFieldValue($fieldName)->GetValue(). When the EmailPlusTemplate is evaluated, this function is evaluated correctly.
Gfov($fieldName)
This function is the equivalent of calling $entity->GetFieldOriginalValue($fieldName)->GetValue(). When the EmailPlusTemplate is evaluated, this function is evaluated correctly.
In some cases, it is possible to use the $entity variable in EmailPlusTemplates for non-specific calls that are not dependent on RecordType. For example, you can use the $entity variable to call $entity->GetFieldsUpdatedThisEntireAction(), which would be evaluated correctly against the EmailPlusTemplate and the record type that the template references.

It is possible to use the resulting array of field names to retrieve field values because it always returns a list of fields that exist on the current entity.