Email Templates and System Email Templates are used to fill the subject and content of emails.
These can be used when:
That is, System Email Templates are provided to differentiate between templates used for emailing standard documents (e.g. invoices), and the templates available in the Write Email Templates window.
Both Email Templates and System Email Templates may be used for the former, but only Email Templates may be used for the latter.
Templates can contain:
The following is a simple template for use when emailing a handout pdf that is not held in the OpenVPMS database - ie you use this template and then manually attached the Kidney function pdf to the email.
The following is a cover note used when emailing an invoice: (this template would be set as the 'Email Template' on the Invoice document template)
The following is used to generate a sexy looking footer block on emails:
See here for an explanation of the fields.
When the Content Type is Document the following document types are supported:
If the Content Source expression doesn't return a valid object, the document will be converted to HTML without merging.
Images are supported, with the following caveats:
See also How To: Email Template Tips - Open Office and How To: Email Template Tips - Jaspersoft Studio
The following shows the email generated by the invoice cover note template:
The following shows the footer generated by the third template:
This is the create/edit/view screen for Email and System Email Templates. These are used to fill the subject and content of emails. Both have the same fields and the only difference between the two is that System Email Templates are not available as templates on the Email Write screen. Both are available as email templates on Document Templates. See here for more background.
The fields are as follows:
Name | The template name |
Description | The template description |
Subject Type |
Determines how the Subject is processed. One of:
|
Subject | The subject to evaluate |
Subject Source |
An optional expression to select the object to evaluate against. This is only applicable when the Subject Type is Macro or Expression. E.g. a value of: $customer would evaluate Subject against the current customer. |
Content Type |
Determines how the Content is processed. One of:
|
Content | The content to evaluate |
Content Source |
An optional expression to select the object to evaluate the Content against. This is only applicable when the Subject Type is Macro, Expression or Document. E.g. a value of: $patient would evaluate Content against the current patient. |
Active | determines if the template is active or inactive. If it is inactive it is not available for selection. |
The Source Expressions can be any expression or variable that sets the object to evaluate the content against. This can be:
When the Content Type is Document the following document types are supported:
If the Content Source expression doesn't return a valid object, the document will be converted to HTML without merging.