12. Mail merge

Mail merge is used to send a similar message such as a newsletter or an announce to a large number of recipients. The program uses the term mailing to refer to a particular mail merging with all its characteristics: title, creation date, template, list of recipients, merge data, sender, subject, status and other details. The body of the messages comes from a template, which is supplied by the user in HTML or plain text format or both. This template may contain placeholders with variables the program will replace with custom data to produce each individual message. The custom data is submitted in a file in CSV format.

12.1. Template

The template is the text of the message, except for the variables it may contain. The text can come from three sources:
  • From files on disk. Either one HTML file or one plain text file, or one for each format.
  • From a previous mailing stored in the database.
  • From a template stored in the database, by the Message->Save as template command of the mail composition window.

Variable names in templates are enclosed in two-brackets pairs, such as {{customer_name}}, or {{customer address}}. Brackets, ampersand and angle brackets are not allowed in variable names. Also, characters that may not be allowed in the header line of a CSV file should be avoided.

If the format chosen for the message is HTML with alternate plain text while only an HTML template is supplied, the text version will be generated by the program. In this case, it is advised to carefully check this generated text version in the mail preview (accessible at the end of the mailing setup). In particular, hyperlinks with a text and target URL come out with only the text. To avoid that, the only way currently is to supply a custom plain text template in a separate file.

12.2. Data file

If there are no variables in the template, the data file must contain the recipient addresses, with one line per recipient. It is not really a CSV file since it has only column, though it is a sort of special case of a CSV file.

If there are variables in the template, the data file must be in CSV format, with column headers on the first line.

As an example: email;title;firstname;name john.doe@mail.tld;Mr;John;Doe jane.doe@mail2.tld;Ms;Jane;Doe

The variables may also be present in the subject line and will be substituted with their values. Example: {{title}} {{lastname}}, only {{delay}} days left to use your coupon

12.3. Control of the sending

The actual sending is done by the manitou-mdx server-side process, and doesn't need the user interface to run. However, the user can start, stop, restart or cancel the mailing anytime within the interface.

12.4. Limitations

Mailings cannot have attachments.

Individual messages from mailings are not stored in the database.

There is no limit to the number of recipients but there is a unique sender for a particular mailing, and it has to be declared as a sender identity in the preferences.

Aside from the subject line, there is currently no way to provide additional header lines.