xmlbase can send email in reaction to any event you can specify in xmlbase's template language.
Email sent by xmlbase is based on templates just like the HTML output. To have xmlbase evaluate an email template, specify its file name (relative to the template file's path) in the main template's Mail-Template header line. Optionally, you have to specify a width to wrap the email's lines to in the Mail-Wrap header.
User: guest Mail-Template: newentry.emt Mail-Wrap: 70 <html> <head> <title>Thanks for adding a new entry</title> |
The email template is executed after the main template, so you can pass values from the main template to the email template. Within email templates, several special rules apply:
You can split the email template output into multiple individual emails by separating them with {insert separator}. Each part must have a full set of email headers as specified below.
Parts consisting solely of whitespace (or nothing) are not processed any further. You can use that feature to conditionally send email by enclosing the entire template (or an entire part) in an {if} clause.
Text wrapping is applied to the final output of the executed email template. Any line starting in + (plus) is excluded from text wrapping (and the + is removed from the output). Lines can start with one or more > (greater-than) to specify a level of whitespace indention that is preserved during the wrapping process; this is handy if you want to include dynamically retrieved or generated text that is to be indented.
The email header lines are separated from the mail body by a single blank line (any additional blank lines will be part of the body). Email headers are parsed and validated before the email is sent; errors can be caught by specifying an error page in the Error-Mail header line. The following header lines are required to be present:
From: <email> To: <email> Subject: Free text |
The following header lines are optional:
Return-Path: <email> Sender: <email> Cc: <email> Reply-To: <email> Date: <date> Organization: Free text X-Custom-Header: Arbitrary |
Fields with <email> content can also contain real names specified in (...) (parenthesis) or "..." (quotation marks). To and Cc may be specified multiple times. Multi-line headers are supported.