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.

Immediate notifications

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} Enabled
{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...

edittopic Create Main.WikiGuestNotifyList now!

TIP 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. on
    win Renders a WIN button to toggle the Immediate Notify status for the entire web. on
    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{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":
  • Foswiki
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":
  • Test\..*Design

TODO

  • Add child notifications (setting an topic and get notifications of all its children)

NTF Popup

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.

TIP 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:

Quiet mode, no results printed.
Dry run - no email sent

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 wink

Author: Foswiki:Main.RichardBaar Foswiki:Main.ProjectContributors
Version: 2.00
Release: 27 Apr 2017
Change History:  
27 Apr 2017 (2.00) Foswikitask:Item11572: Syntax errors in the code.
Foswikitask:Item14327: Errors generated when saving a new userNotifyList.
Foswikitask:Item14325: Unescaped braces fail in latest perl.
Foswikitask:Item14326: Non-existing global variables are referenced.
Foswikitask:Item11574: Notification buttons and popup are not working.
Foswikitask:Item14378: mailnotify-NP script is not functional.
12 Sep 2010 (1.20) Foswikitask:Item8428: Lose SENDER
21 May 2007 (1.15) TWikibug:Item3969: 8bit email fix (Foswiki:Main.WillNorris)
11 May 2004 (1.14) Version 1.14 - popup support for changing notifications
29 Apr 2004 (1.13) Version 1.13 - mailnotify script bugfix
28 Apr 2004 (1.12) Version 1.12 - bugfix
28 Apr 2004 (1.11) Version 1.11 - bugfixes
25 Feb 2004 (1.05) Version 1.05 - bugfix
24 Feb 2004 (1.04) Version 1.04 - bug-fix of immediate notifications
24 Feb 2004 (1.03) Version 1.03 - added SENDER variable, bug-fixes
26 Apr 2004 (1.01) Version 1.1 - new functions; added support for fast setting notifications
14 Jan 2004 Initial version

PackageForm edit

Author Foswiki:Main.RichardBaar Foswiki:Main.ProjectContributors
Version 2.00
Release 27 Apr 2017
Description Send fine grained notifications of changes to topics you are interested in.
Repository https://github.com/foswiki/NotificationPlugin
Copyright © 2004, Foswiki:Main.RichardBaar
© 2004-2010 Foswiki:System.ProjectContributor
License GPL (GNU General Public License)
Home http://foswiki.org/Extensions/NotificationPlugin
Support http://foswiki.org/Support/NotificationPlugin
Topic revision: r1 - 2017-04-29, UnknownUser
This site is powered by FoswikiCopyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding CMS Wiki? Send feedback