A message template file can contain the following sections:
  • A required header section describing the sender, recipients, subject, and other header elements. This section must appear exactly once, and it must be the first section of the template file.
  • An optional section providing a plain-text version of the message body. This section may appear at most once, and at least one of the plain-text and HTML-formatted body sections must be present.
  • An optional section providing an HTML-formatted version of the message body. This section may appear at most once, and at least one of the plain-text and HTML-formatted body sections must be present.
  • An optional section providing information about an attachment to include in the message. This section can be included zero, one, or multiple times, and all attachment sections must appear after all other sections.

A message template file must start with a header section that specifies the recipient and sender addresses, the message subject, and the values of any custom headers that should appear in the message. It also indicates whether the template should be enabled and used to send email messages.

The header section must begin with the line ----- BEGIN HEADERS -----, and may contain a number of name-value pairs that provide information about the message. Each name-value pair should appear on a separate line, and the name and value must be separated by a colon and optional spaces. The header section can include the following:
  • ENABLED -- Specifies whether this template is enabled and should be used to generate an email message. This element must be present and must have a value of either true or false. This is primarily intended for cases in which a message should only be generated under certain circumstances. If you do not ever want a message sent for a particular notification type, you should not specify a template file for that notification type in the configuration for the multi-part email account status notification handler.
  • TO -- Specifies a primary recipient for the email message. This recipient will be visible to all recipients. The value can be either an email address (for example, jdoe@example.com) or a name followed by the email address in angle brackets (for example, John Doe <jdoe@example.com>). To specify multiple TO recipients, this element can be specified multiple times.. It can be omitted if the message should have only CC or BCC recipients, but the message must have at least one TO, CC, or BCC recipient.
  • CC -- Specifies a carbon-copied recipient for the email message. This recipient will be visible to all recipients. The value can be either an email address (for example, jdoe@example.com) or a name followed by the email address in angle brackets (for example, John Doe <jdoe@example.com>). This element can be specified multiple times to specify multiple CC recipients. It can be omitted if the message should have only TO or BCC recipients, but the message must have at least one TO, CC, or BCC recipient.
  • BCC -- Specifies a blind carbon-copied recipient for the email message. This recipient will not be visible to other recipients. The value can be either an email address (for example, jdoe@example.com) or a name followed by the email address in angle brackets (for example, John Doe <jdoe@example.com>). This element can be specified multiple times to specify multiple BCC recipients. It can be omitted if the message should have only TO or CC recipients, but the message must have at least one TO, CC, or BCC recipient.
  • FROM -- Specifies the address from which the email message should appear to be sent. This value can be either an email address (for example, jdoe@example.com) or a name followed by the email address in angle brackets (for example, John Doe <jdoe@example.com>). This element must be specified exactly once.
  • REPLY-TO -- Specifies the default address to which replies should be sent. The value can be either an email address (for example, jdoe@example.com) or a name followed by the email address in angle brackets (for example, John Doe <jdoe@example.com>). This element is optional and can only be specified once.
  • SUBJECT -- Specifies the subject for the email message. This element must be specified exactly once.
  • HEADER -- Defines a custom header that should be included in the email message. The header value itself should be a name-value pair with the name and value separated by a colon and optional spaces (for example, X-Custom-Header-Name:Custom Header Value). This is an optional element and can be specified multiple times to specify multiple headers with the same or different names.

The header section must be followed by plain-text and HTML-formatted body sections. Each of these sections consists of free-form text that can span multiple lines and continues until the beginning of the next section or the end of the template file is reached.

If a plain-text body is included, it must begin with the line ----- BEGIN PLAIN-TEXT BODY -----. If an HTML-formatted body is included, it must begin with the line ----- BEGIN HTML BODY -----. At least one of these sections must be included. If an HTML-formatted body section is included, it is recommended that a plain-text body also be included for the benefit of clients that prefer plain text or cannot handle HTML content. Any blank lines at the beginning or end of the body text will be removed, but blank lines in the middle of the body are preserved.

The template can also contain any number of optional attachment sections that describe any attachments that should be included in the message. Each attachment must be specified in its own section at the end of the template, after the header, plain-text, and HTML-formatted body sections. Each attachment section must begin with the line ----- BEGIN ATTACHMENT ----- and can include the following elements (using the same colon-delimited syntax used in the header section):
  • FILENAME -- The name (without any path information) of the file to be attached. This must be specified, and the file must exist in the same directory as the template file.
  • CONTENT-TYPE -- The MIME type for the attachment. This is an optional element. If it is not specified, a default content-type of application/octet-stream is used.
  • INLINE -- If true is specified, indicates that the attachment should be an inline attachment (for example, an image that should be referenced within the HTML body, in which case the image source path should be specified as cid: followed by the filename (for example, `cid:company-logo.png)). If present, this value must be either true or false. If it is omitted, a default value of false is assumed.