The latest version (0.97) of this plugin is given with my post of Sat 08 Oct, 2011.
See my post of Tue 05 Jul, 2011 at 5:59pm, for some changes as to how this plugin is to be implemented.
(The version which was attached here had been updated to version 0.953 on 20110616 to fix problems reported by boxbreak on 14 and 16 June 2011. This version has now been removed. The latest version is 0.97 and attached to my post of Sat 08 Oct, 2011.)
Four types of placeholders are available: HTML, text, PHP:Date, and PHP:Eval. There are in addition four "hard-wired" placeholders (see below).
Enhanced Placeholders use the convention of "{" and "}" -- rather than "[" and "]" -- for placeholder delimiters. This allows "[" and "]" to be used for constructs in emails other than placeholders without creating possible conflicts.
These placeholders can be used in the subject line as well as the content of HTML and text messages. They can also be nested -- i.e., a placeholder can be used as part of a different placeholder.
Placeholders of the form {PLACEHOLDER} can be used instead of those of the form [PLACEHOLDER] for many instances of the latter.
You can create placeholders of a number of different types using the "add a new placeholder" link on the "Enhanced Placeholders" page of the phpList administrative section. Any of the placeholders that you add can then be edited or deleted/removed .
If the type of the placeholder is "HTML," a field is available for entering what should be used in the text portion of an email or in the subject line.
There are four "hard-wired" enhanced placeholders:
- {EMAIL}: the email address of the person to whom an email is sent.
- {MID}: the message id.
- {UID}: the unique id of the person to whom the email is sent.
- {VIA_LIST_NAMES}: the names of the lists via which a specific message is sent. The names of the lists are separated by a dash (-).
- Code: Select all
// Use the Enhanced Placeholders plugin to process placeholders before the legacy code does. MDG 10101020
$GLOBALS['plugins']['enhancedPlaceholders']->processEnhancedPlaceholders($messageid, $userdata, $user_att_values, $html, $text, $cached[$messageid]["template"], $htmlmessage, $textmessage, $cached[$messageid]["subject"]);
// End of change for use the Enhanced Placeholders plugin to process placeholders before the legacy code does.
at line 239 of sendemaillib.php, just before "## Parse placeholders." (This is the line number for phpList 2.10.12. It may be different for other versions.)
This plugin is still a "beta" version. It has, however, been tested fairly extensively and found to work well for those cases for which it has been tested.
The option to use placeholders which evaluate PHP code has not been thoroughly tested. It is possible even that it may be found to caused more problems than it solves, in which case it will be removed from future versions.
When this plugin is used, in order to process queues using cron jobs one must use something similar to "What finally worked for me was to set up a curl call in a php script as follows:" at http://docs.phplist.com/CronJobExamples. Other approaches seem not to properly initialize the plugin.