NotificationPlugin
Send fine grained notifications of topics you are interested in
Allows you to specify to kinds of notifications - immediate and regular. Immediate notifications are sent every time somebody changes the requested topic, regular notifications are the same as default Foswiki notifications, but allows better settings.
Notification Types:
There are two types of notifications - Immediate and Normal.
This type of notification is send immediately after a user changes a watched topic. This type of notification is send even if the user uses
Quiet Save or checks the (deprecated) 'Don't notify' checkbox.
This means that you will be notified for ANY change which is made in selected topics or webs. But, on the other hand, this is also the best way to be spammed with many mails if you set immediate
notification on whole webs if topics in this web are often changed. You have to decide when to use this type of notification.
Regular notifications
This type of notifications is similar to the default Foswiki notification system -
MailerContrib, but it also ignores the "Don't notify" checkbox. This notificaiton type requires a cron-job to
run the mailnotify rest handler.
The site administrator can chose which types of notifications to allow, by
setting options in
/bin/configure in the Extensions ->
NotificationPlugin tab.
Current settings:
{Extensions}{NotificationPlugin}{EnableImmediateNotify} |
Disabled |
{Extensions}{NotificationPlugin}{EnableNormalNotify} |
Disabled |
Syntax Rules
You can create a topic
%Your_user_name%NotifyList in
Main web from template
NotificationPluginListTemplate. Fill it with desired topics, webs and regexps and enjoy...
Create Main.WikiGuestNotifyList now!
The headings in the topic are important. If the headings are missing, the
notifications will not be performed.
If the topic is missing, and you use one of the buttons provided by the
NTF
macro, it will be automatically created.
NTF Macro
For adding
fast switching to notifications you can use
%NTF{}%
macro:
Parameters
- The following attributes are recognized:
Name | Description | Default |
popup | Renders a "Notifications" button, which invokes a popup menu for setting notificaions. | off |
The following settings all default to off if popup is enabled |
tin | Renders a TIN button to toggle the Immediate Notify status of the topic. | Disabled |
win | Renders a WIN button to toggle the Immediate Notify status for the entire web. | Disabled |
tn | Renders a TN button to toggle the Normal Notify status of the topic. | Disabled |
wn | Renders a WN button to toggle the Normal Notify status for the entire web. | Disabled |
NTF examples (if installed)
-
%NTF{}%
- displays all four buttons
-
%NTF{win="off" wn="off"}%
- displays only buttons for topic immediate notification and regular topic notification
- %NTF{win="off" wn="off"}%
-
%NTF{popup="on"}%
- Displays a link or button to open the Update Notifications dialog.
Description of NotifyList topics
Subtypes
The syntax of setting a notification is with bullet Foswiki list.
Example:
If you put following line in "Topic immediate notifications" section when anybody change this topic you will get notification about the change:
If you want to set immediate notifications on web
Foswiki add this line under "Web immediate notifications":
If you want to set immediate notifications on all topics in web Test and topics which contains string 'Design' in the name add following line in "Regex immediate notifications":
TODO
- Add child notifications (setting an topic and get notifications of all its children)
This block is displayed into a JQDialog pop-up when the Notifications button / link
generated by the
%NTF{popup="on"}%
macro is pressed.
%STARTSECTION{"notification"}%
<div id='changenotify' title="%MAKETEXT{"Change Notification"}%" class="jqUIDialog { modal:true, resizable:false, draggable:false, width:400, autoCenter:true, cache:false}">
<form method="post" action="%SCRIPTURLPATH{"rest"}%/NotificationPlugin/changenotify">
<input type="hidden" name="popup" value="1" />
<input type="hidden" name="topic" value="%URLPARAM{"notifyweb"}%.%URLPARAM{"notifytopic"}%" />
---++ <nop>%URLPARAM{"notifyweb"}%.%URLPARAM{"notifytopic"}%
%IF{"context NotificationPluginImmediate" then="
---+++ Immediate Notifications
<input type='checkbox' name='TIN' value='ON' %URLPARAM{"TIN"}% >changes to the Topic<br/>
<input type='checkbox' name='WIN' value='ON' %URLPARAM{"WIN"}% >changes to the Web<br/>
"}%
%IF{"context NotificationPluginNormal" then="
---+++ Normal Notifications
<input type='checkbox' name='TN' value='ON' %URLPARAM{"TN"}% >changes to the Topic<br/>
<input type='checkbox' name='WN' value='ON' %URLPARAM{"WN"}% >changes to the web<br/>
"}%
<input type='hidden' value='Update' name='action'></form>
<a class="jqUIDialogButton jqUIDialogSubmit jqUIDialogClose {icon:'ui-icon-circle-check'}" >%MAKETEXT{"Change"}%</a>
<a id='cancelLink' class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a>
</div>
%ENDSECTION{"notification"}%
Sending "Normal" notifications.
Note that normal notifications are disabled in
bin/configure by default.
Normal (batch) notifications are sent by running a REST handler
NotificationPlugin/mailnotify
. As the command writes to the logs, be sure
to run it with the web server userid, to prevent file ownership changes.
Option |
Description |
-q=1 |
Quiet mode. No output is printed. Basic information logged to the Foswiki debug log. |
-n=1 |
Dry-run. No email will be sent. The run timestamps are not changed. |
Sample crontab entry:
The following entry would run an offline notification every 8 hours at 15
minutes past the hour.
15 */8 * * * cd /path/to/website/bin/bin && perl ./rest /NotificationPlugin/mailnotify -q=1
Run a normal notification now:
An administrator can also run the notifications now by sending a POST to the
rest handler:
Plugin Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Some unusual files are installed that are worthy of mention:
templates/htmlchanges.tmpl |
Template for generating HTML mails with notifications |
templates/view.notify.tmpl |
Template overrides the SubscribePlugin's "subscribe" link with a link to "Update Notifications" dialog. |
If you want a "Notifications" button to be automatically provided on every
page, enable the override to the Skin by the "notify" skin template:
- Set SKIN = notify,natedit,pattern
Note that a number of template files no longer ship with this extension. The
did not appear to be used. Please
open a task
if they are required. The templates are
changes-*.tmpl
and
mailnotify-*.tmpl
Info
Original version sponsored by
Systinet