Mailer Contrib<-- Contributions to this TWiki extension are appreciated. Please update the page at http://twiki.org/cgi-bin/view/Plugins/MailerContrib IntroductionThe Mailer Contrib allows users to "subscribe" to regularly scheduled e-mails containing either:
tools/mailnotifyThe central component of MailerContrib is a script,tools/mailnotify , that generates and sends out the emails based on analysis of
cron (or an equivalent off-line job scheduler), or from the command-line.
The script collates the changes emails so that each subscriber only receives one changes notification for all changes in all webs in the TWiki. Furthermore, users can elect to receive just summaries of changes, or the entire content of topics that have changed.
Each web can optionally contain a topic called WebNotify.
<-- Included by WebChangesAlert -->Users subscribe to email notifications using their WikiName or an alternative email address, and can specify the webs/topics they wish to track, Whole groups of users can also be subscribed for notification. The general format of a subscription is: three spaces * subscriber [ : topics ]
Where subscriber can be a WikiName, an E-mail address, or a
group name. If subscriber contains any characters that are not legal in
an email address, then it must be enclosed in 'single' or "double" quotes. Please note that the guest user TWikiGuest does not have an email address mapped to it, and will never receive email regardless of the configuration of that user.
topics is an optional space-separated list of topics:
* daisy.cutter@flowers.comSubscribe Daisy to all changes to topics that start with Web .
* daisy.cutter@flowers.com : Web*Subscribe Daisy to changes to topics starting with Petal , and their immediate children, WeedKillers and children to a depth of 3, and all topics that match start with Pretty and end with Flowers e.g. PrettyPinkFlowers
* DaisyCutter: Petal* (1) WeedKillers (3) Pretty*FlowersSubscribe StarTrekFan to changes to all topics that start with Star except those that end in Wars , sInTheirEyes or shipTroopers .
* StarTrekFan: Star* - *Wars - *sInTheirEyes - *shipTroopersSubscribe Daisy to the full content of NewsLetter whenever it has changed * daisy@flowers.com: NewsLetter?Subscribe buttercup to NewsLetter and its immediate children, even if it hasn't changed. * buttercup@flowers.com: NewsLetter! (1)Subscribe GardenGroup (which includes Petunia) to all changed topics under AllnewsLetters to a depth of 3. Then unsubscribe Petunia from the ManureNewsLetter, which she would normally get as a member of GardenGroup: * GardenGroup: AllNewsLetters? (3) * petunia@flowers.com: - ManureNewsLetter | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Subscribe IT:admins (a non-TWiki group defined by an alternate user mapping) to all changes to Web* topics. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Subscribe IT:admins (a non-TWiki group defined by a custom user mapping) to all changes to Web* topics. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* 'IT:admins' : Web* | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | In addition to single quotes ('), double quotes (") do the same job for a non-TWiki group. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A user may be listed many times in the WebNotify topic. Where a user has several lines in WebNotify that all match the same topic, they will only be notified about changes that topic once (though they will still receive individual mails for news topics). If a group is listed for notification, the group will be recursively expanded to the e-mail addresses of all members. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | ![]() {MailerContrib}{EmailFilterIn} setting in =configure . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | ![]() {MailerContrib}{EmailFilterIn} setting in =configure . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() cron job that runs the mailnotify script.
Note that when using the "news mode" ! or ? specifiers the entire topic text is mailed out as HTML. The newsletter template is used to generate the content in this mail, using whatever skin is selected in the topic being mailed.
In addition, the %STARTPUBLISH% and %STOPPUBLISH% markers used by TWiki:Plugins.PublishContrib![]() TWiki/Contrib/MailerContrib code libraryThe second part of the module is a code library that provides the services for other applications to modify the subscription topics through a clean, well documented API. This allows (for example) plugin developers to add (for example) a "Register me for this newsletter" button to their pages. Developers should refer to the POD documentation for the WebNotify class as their starting point.Installation InstructionsThis module is pre-installed. TWiki administrators can upgrade it as needed on the TWiki server.<--/twistyPlugin twikiMakeVisibleInline-->
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Additional settings
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Additional settingsRestricting email addressesYou can change the regular expression that matches email addresses in WebNotify using the{MailerContrib}{EmailFilterIn} setting in configure . This allows you to limit the domains to which emails can be sent, or even block email addresses altogether.
Custom user/group notations without quotesAs mentioned in the'IT:admins' example above, you can use custom user/group notations in WebNotify by surrounding them with single quotes (') or double quotes (").
But surrounding them in quotes is inconvenient especially because quotes are not needed for access control.
So you can set {MailerContrib}{CustomUserGroupNotations} to a regular expression matching the custom notations in configure .
If you do that, you don't need to put those into quotes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<--/twistyPlugin--> Setting up your cron job(s)You need to set up acron (or equivalent) job to run the tools/mailnotify perl script.
The script is used as follows: perl -I bin mailnotify [-q] [-news] [ web1 web2 ... webN ]
/usr/local/twiki , this cron entry:
0 0 * * * cd /usr/local/twiki && perl -I bin tools/mailnotify -q Public Privatewill generate change notifications for the Public and Private webs every night at midnight. (Google for crontab for more information on what all the 0 0 * * * fields mean)
0 0 * * * cd /usr/local/twiki && perl -I bin tools/mailnotify -q -Sandboxwill generate change notifications for all webs, except the Sandbox web.
0 0 * * 0 cd /usr/local/twiki && perl -I bin tools/mailnotify -newswill generate newsletters from all webs every week on midnight Saturday. ![]() ![]() <--
Developer NotesThe changes mails sent to subscribers are based on a TWiki template calledmailnotify . This template must contain the following definitions.
view template, using whatever skin is selected in the topic being mailed.
Contrib InfoMany thanks to the following sponsors for supporting this work:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<--/twistyPlugin twikiMakeVisibleInline--> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<--/twistyPlugin-->
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Related Topics: TWikiPreferences | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Related Topics: TWikiPreferences, CustomUserGroupNotations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||