Section 9 Customizing Mail and Web Templates Using the Web Interface
The majority of Web Interface pages and administrative messages sent to subscribers can be customized. Customizing your list’s Web pages and administrative messages creates an individual look and tone for your list. Subscribers will see Web pages and read administrative messages that are specific to your list, containing pertinent information and instructions rather than just generic pages and messages.
The template editor allows the site administrator and list owner to customize the majority of the Web Interface Pages and Administrative Messages sent out by LISTSERV. There are two types of templates you can customize – Web and Mail.
Web Templates (also referred to as Dynamic Web Templates) control the pages produced by the Web Interface. These pages are produced dynamically when they are accessed. What gets displayed by the browser depends on the circumstances and may change depending on who is accessing the Interface, which list they are accessing, the settings of that list, and so on.
Mail Templates control text produced by LISTSERV itself. Although generally categorized as mail templates, they actually fall into three different types:
•
|
Message Templates supply text that will ultimately be shown to the user. These messages may be included in a mail template; or they may be included in an email sent by LISTSERV in response to LISTSERV commands sent by email to the LISTSERV command address; or they may be returned to the Web Interface in response to commands sent through the Web Interface. Limited formatting is available.
|
•
|
Message Fragments templates are the lowest level of mail templates. Fragments are pieces of text produced by LISTSERV as parts of other messages or emails. For example, list digests must follow a certain format dictated by the Internet RFCs. Therefore, it is not possible to provide a complete mail template for digests. However, some of the text within the digest is not mandated by the RFCs, and so LISTSERV provides some fragment templates to control these parts, for example MSG_DIGEST_FRAGMENT_DATERANGE1 to control the date range and MSG_DIGEST_FRAGMENT_PREAMBLE1 to control the text preceding the table of contents. Formatting commands are generally not available in fragments.
|
Notes: Mail-merge fields are now allowed in Mail templates.
To access the template editor, click on the List Management or
Server Administration menu, select
Customization, and then select either
Web Templates or
Mail Templates.
Many list owners prefer to customize some of the administrative messages sent to subscribers and the main Web page for the list archives. However, it is not necessary to customize any of the templates. Customizing templates can be complex for new users, so it is not covered in depth in this manual. The table below lists some of the templates you will most likely to want to customize.
•
|
Deleting a template in the Web Interface template editor or removing it from the listname.mailtpl file (when customizing by email) will not prevent a message from being sent. It merely deletes the customizations and results in the default message being sent. The way to prevent a message from being sent is to customize the template by inserting the directive “ .QQ” on a line by itself. Be careful, if you add “ .QQ” to a template that is included in other templates, you will be canceling those templates as well.
|
•
|
Variables begin with an ampersand (“&”) and may end with a semicolon. You may remove variables from the text if you do not wish to customize that part of the text. For example, the ADD1 template contains the text “ You have been added to the &LISTNAME mailing list (&TITLE) by &MBX(&INVOKER)”. The “ &LISTNAME”, “ &TITLE”, and “ &MBX(&INVOKER)” will be replaced by the list name, title, and the name and email address of the owner that added the subscription. This is easily changed to “ You have been added to the &LISTNAME mailing list (&TITLE) by the list owner” if you do not wish to reveal the name and address of the owner.
|
The Global Skins (SKIN) template now contains an option to force the browser to use a specific character set for cases where the browser’s auto-detect feature fails to use the correct character set. This variable, DEFAULTCHARSET, can be defined for the site as a whole or for particular lists that are known to use a specific character set. To set, simply change the default setting of 0 to the appropriate charset, such as ISO-8859-5.
To change this variable for all of your lists, click on the Server Administration menu, select
Customization, and then select
Web Templates. Search for the Global Skins template by entering either Global Skins or SKIN in the
Search Template field, and then click
[Search]. Edit the template by changing DEFAULTCHARSET to the desired character set.
To change this variable for a specific list, click on the List Management menu, select
Customization, and then select
Web Templates. Select the list you’d like to work with, and then search for the Global Skins template by entering either Global Skins or SKIN in the
Search Template field and click
[Search]. Edit the template by changing DEFAULTCHARSET to the desired character set.
To select a side-wide default template, click on the Server Administration menu, select
Customization, and then select
Mail Templates. The Mail Template Editor opens.
To select a default template for a list, click on the List Management menu, select
Customization, and then select
Mail Templates. The Mail Template Editor opens. Click the
Select List drop-down menu, and then select the list to define the default template for. The Mail Template Editor refreshes with the HTML Mail Template Gallery displayed.
In the HTML Mail Template Gallery, select an HTML mail template by clicking the [Select] button associated with the template you want to use. The screen will refresh with the selected template displayed in the
Mail Template Style box.
To edit a template, click the Easel icon. The Edit HTML Mail Template screen opens, which is where you can make any changes necessary. If you have made changes to a default template and would like to undo those changes, click the
Revert icon associated with that template.
To create a new template based on a default template, simply edit that template and change the template name before clicking the
[Save] button. The template will now be saved with the new name.
To create a new template from scratch, click on the Create HTML Mail Template option. The Create HTML Mail Template screen opens, which is where you will enter the content for the new template. See the special documentation on that screen to learn more about the format of the HTML mail templates.
Tips: When creating new templates, make sure that the template name starts with HTMLMAIL- and it will be automatically included in the list of available HTML mail templates within the editor.
To delete a template, click on the Recycling Bin icon associated with that template.
The web interface CGI now supports LISTSERV's conditional expression evaluator for templates, made available as +IF. For instance, it is now possible to code the following in a template:
+IF HELLO =* HE*
*do something here*
+ENDIF
+IF (5 > 6)
*do something here*
+ENDIF
(+ENDIF is an alias for +EB; you can use either.)