Section 1
Introduction

Section 2
The Maestro Interface

Section 3
Defining a Job

Section 4
Defining Recipients

Section 5
Defining Content

5.3 HTML Messages

5.4 Attachments

5.5 Langauage Character Set

5.6 Merge Fields and Conditional Blocks

5.7 Merged Parameters within URLs

Section 6
Defining Tracking

Section 7
Sender and Delivery Options

Section 8
Outbox

Section 9
Delivered Jobs

Section 10
Reporting and Statistics

Section 11
User Settings

Appendix A
24 Hour Clock

Appendix B
International Character Sets

Appendix C
Comma Separated Files

Appendix D
AOL Rich Text

5.6 Merging Fields and Conditional Blocks

LISTSERV provides the ability to customize mail messages for each recipient by merging in values uploaded with the recipient data or conditionally including blocks of text based on the preferences indicated in the recipient data. These values are taken from columns that are present in the recipient data.

To merge a field into the message, simply enter the field name (or header name in the case of an uploaded file), used in the recipient definition and precede it with an ampersand ("&") and follow it with a semi-colon (";").If the recipients data is derived from a LISTSERV list, then the only merge substitution fields available are &*TO; for the e-mail address and &*NAME; for the name.For a list of available merge fields, click the link Show Merge Fields and Drop-Ins at the bottom of the text box on the HTML Source or the Alternative Text screen. Copy and paste the name of the merged field into the message to ensure the correct name and formatting. (See Figure 24)

The following example demonstrates how overdue book notices can be customized using specific recipient data in the form of the fields EMAIL, NAME, IDNUM, BRANCH, BOOK1, BOOK2, BOOK3. A text message merging the fields might look like this:

Figure 30 Merge Fields Example

Dear &NAME;,

The following book(s), borrowed using library ID card #&IDNUM;, are overdue:

- &BOOK1;

- &BOOK2;

- &BOOK3;

Please return them to the library at &BRANCH; as soon as possible.

Sincerely,

Your Librarian

****************************************************************

Note: This e-mail was sent to &EMAIL; -- if you wish to change

the e-mail settings for library ID &IDNUM;, please visit "http://library.example.com/mylibrary"

***************************************************************

 

In an HTML message, the HTML source should be altered to include the merge fields, being careful to respect the HTML code.

In an HTML message with alternative text, remember to put the merge fields in both the HTML source and the alternative text.

Conditional blocks are coded by using the ".BB", ".ELSE", and ".EB" directives. These directives must each be on a line by itself. The ".BB" directive begins the conditional block, and "condition" follows ".BB" on the same line. The ".ELSE" directive is optional and starts a text block to be used for the opposite condition as was used for the ".BB". The ".EB" directive ends the conditional block. Fields used in a conditional block should be preceded by the ampersand, but should not be followed by a semicolon. Lines that start with dot asterisk ".*" are used as comments and do not appear in the final message to the recipients.

For example:

Figure 31 Conditional Block Example

.* If BOOK2 is blank, then use the singular phrasing
.BB &BOOK2 = ""
The following book, borrowed using library ID card #&IDNUM;, is overdue:
.ELSE
The following books, borrowed using library ID card #&IDNUM;, are overdue:
.EB

&BOOK1;
.* To avoid extra blank lines, we only include the lines for
.* other books if they are not blank.
.BB &BOOK2 ^= ""
&BOOK2;
.EB
.BB &BOOK3 ^=""
&BOOK3;
.EB

 

If conditional blocks are used in an HTML message, first create the basic HTML message, then go into the HTML source code and correctly insert the conditional statements, making sure to maintain proper HTML syntax once the directives are followed. The HTML page will now look incorrect because the directives are interpreted as part of the HTML source. It is important to test all possible conditional values in the testing stage (see Section 7.2), to make sure that the HTML code works correctly in all cases.

Mail-merge substitutions and conditional blocks are explained in more detail in the LISTSERV Developer's Guide.