MailMerge, or Personalisation, is a feature of the Sympa mailing list system that allows you to personalise messages sent to a list, so that each recipient receives a different message.
You could use this to simply insert the recipient's name into the message, or to include a clickable link to unsubscribe. You could define custom data for the list and include that. You could even perform calculations, and switch sections of the message on or off depending on other data.
To enable MailMerge on a list, you need to be the List Owner. Then, in the List Admin pages, you can edit the list Send/Receive Configuration and set the MailMerge Feature to be 'on'. This will result in all future postings to the list being processed by the 'TT2 Template Processor' before distribution to each subscriber. It is this processor that performas the merge function.
Points to note are:
There is a List Creation Template available for making Mail-Merge lists with the recommended settings.
The recommended way to use a MailMerge list is to first build a template for your mailouts in your mail client, probably including any common headers and footers, and maybe tracking informatrion (see the later section on tracking). Then, you can use this template to build your mailouts.
If you are using one of the 'mailmerge' Send Scenari, then you can run a test mailout by having the string "SYMPA-TEST" (all in capitals) in the message subject line. If this is present, then then message will only be sent to yourself (make sure you are a list member, though, if you want to have any metadata merging taking place!).
Alternatively, you can create a separate mailmerge list for testing purposes that only includes yourself as a member (and possibly other test users if you wish).
Note that the Tracking module does not work on Test mailouts.
In the list definition, you can define additional custom variables associated with either individual subscribers, or with the list itself. For example, you could add a field 'colour' to hold the subscribers' favourite colours, and then refer to this field as user.custom_attribute.colour.value in your template.
Custom variables can have different types, and are set manually by the subscriber at subscription time or when they edit their subscription settings via the wbe interface. You can make variables mandatory if you wish, so that people cannot subscribe to the list without giving the information.
You can dump the available 'stash' (the variables namespace) by using the UOA module. This will inject some HTML to show you the current variables and their values.
[% Use UOA %] [% UOA.stash(html=1) %]
The MailMerge system allows you to track who has viewed messages, and also count the clickthrough on the embedded links. To enable this, see the documentation on the Tracking Page.
There are several places you can read more on the use of TT2 mail templates.
There are a number of things that might go wrong in your merge.
Here is an example of a MailMerge message, and an example of what might actually be received by the end user. The user Sid Bloggs (sidb@foo.com) is a subscriber of the fubar@sympa.auckland.ac.nz mailing list. The mailing list defines a custom metadata field, 'colour', for which Sid has chosen 'red'.
[% IF user.gecos -%]
[% SET names = user.gecos.split(' ') -%]
[% SET firstname = names.0 -%]
[% IF firstname.length == 1 -%]
Dear Sir,
[% ELSE -%]
Dear [ % firstname %],
[% END -%]
[% ELSE -%]
Dear Sir,
[% END -%]
I know you like the colour [% user.custom_attributes.colour.value %].
Blah, blah, blah.
To unsubscribe, click here: [% wwsympa_url %]/auto_signoff/[% listname %]/[% user.escaped_email %]
The user receives this:
Dead Sid,
I know you like the colour red. Blah, blah, blah.
To unsubscribe, click here: https://sympa.auckland.ac.nz/sympa/auto_signoff/fubar/sidb%40foo.com
If the user's name were 'S Bloggs' then you'd get 'Dear Sir,', as the length of the first part of the name is only 1. Sinilarly, if there were no name defined, you would also get 'Dear Sir,'.