A formal congratulatory letter.
The letter displays the current date using the $nowUTC variable.
This example shows how the <<op: feature may be used as an alternative to the conditional <<cs_ directive for optional paragraphs in the body of a letter.
Word’s shape feature is used to create an effective background for the header, and to draw a horizontal line in the footer.
This example in detail
This example uses date formatting, the map function and the optional <<op: paragraph feature.
Using optional paragraphs
In letters, the <<op: feature is commonly used to remove blank address lines.
However, <<op: can also be used effectively to remove entire paragraphs from the body of the letter, if they are not applicable based on the supplied data.
In this example, one of the paragraphs includes <<op:awardName. If there is no value for awardName, then this entire paragraph is stripped from the letter.
Using the map function
The map function is used to map one value to another.
<<{map(grade, ‘HD’, ‘High Distinction’, ‘D’, ‘Distinction’, ‘C’, ‘Credit’, ‘P’, ‘Pass’, ‘CP’, ‘Pass’)}>>
In this instance, the map function replaces the grade with its associated description.
That is, it will lookup grade in the data and if it equals "HD" replace it with "High Distinction", if it is "D" replace it with "Distinction" and so forth.