I uploaded a new version (0.96) of the plugin with this post. It incorporated all of the feedback received to date, for which I am very grateful -- especially that of duncanc, culminating in his posting of revised code at 1:50pm, 16 June 2011. The revisions in that posting have been completely incorporated into this version of this plugin. I have now removed this version, since it has been superseded by version 0.97, uploaded with my post of Sat 08 Oct, 2011.
This requires, also, a slightly different set of modifications to admin/sendemaillib.php, than those I put into my original post. I repeat them here from duncanc's post of 1:50pm, 16 June 2011, so that the most recent set of changes is all in one place:
Two changes are required to file admin/sendemaillib.php. Copy and paste the text rather than retyping.
1) add this line after the require statement on line 2
- Code: Select all
include_once PLUGIN_ROOTDIR.'/enhanced_placeholders/enhancedPlaceholdersPopulate.php';
2) add these lines immediately before line 240 , ## Parse placeholders
- Code: Select all
/*
* Addition to process enhanced placeholders
*/
$obj = enhancedPlaceholdersPopulate::instance();
$obj->processEnhancedPlaceholders(
$messageid, $userdata, $user_att_values, $html, $text, $cached[$messageid]['template'],
$htmlmessage, $textmessage, $cached[$messageid]['subject']
);
Note that this version incorporates the singleton design pattern (
http://php.net/manual/en/language.oop5.patterns.php). This works very well. If your application requires an extension of the enhancedPlaceholdersPopulate class, however, I believe you will need to bypass the singleton design pattern and use a different approach. Since this is not likely to be the case for most of you, I will not belabor the topic further in this posting.