Module Bulkmail, to be found at Newsletter item in Admin menu, has been enhanced to provide new options and enhanced capabilities:
New features in the user interface are a role group selector (useful in portals with a large number of roles) and a new advanced setting "replace Tokens?". Enable this option, to allow personalization anywhere in the body and subject (instead of the current "Dear <Displayname>," that is currently still used, if "replace Tokens" is false). in send mathod "TO", you can use any user, membership or profile property of the addressed user, in any method you can also use portal and date/time properties. To insert a token, place object and property name placed in brackets, like
Dear [user:displayname],
today ist [dateTime:current], we send greetings to [profile:city].
Your team of portal [portal:PortalName]
There are minor difficulties:
- for anonymous users, neither displayname nor city are specified.
- datetime shall display weekday only
to overcome those limitations, TokenReplace allows to specify a format and a value, if property not found, both separated by "|" character. Format can also be used with strings, using {0} as placeholder for the string value itself:
Dear [user:displayname|{0}|User],
today ist [dateTime:current|"dddd"][profile:city|, we send greetings to {0}].
Your team of portal [portal:PortalName]
A more detailed manual will be provided lated, currently there is a list of available tokens in the UDT 3.4.0 manual.
Please note, that the previous send method is still available in current version, if you turn off "TokenReplace" option. In next version, this shall be used to allow suppression of token replacement. Further enhancements will be added to grant access to new options of the called class, like adding multiple attachments.
Other enhancements are added to the send report, that is returned to the sending user by email after completion. It now contains detailed error messages and the list of email addresses, who got the mail.
For developers, who want to include bulkmails into their own modules, there is a new class SendTokenizedBulkMail with an easy to use interface, I will describe in a future post.
I hope, you enjoy these enhancements.