Generate Course Completion Letters from Template

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.

 

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam. Please also consider contacting support@docmosis.com if you need help with this article.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input

Document Gallery

Docmosis showcases its template-based document generation capabilities through a gallery of downloadable PDF documents. The gallery features a mixture of real documents provided by customers as well as links to PDFs generated from example templates, desgined to illustrate the versatility of Docmosis.