Linked from subscription

It appears this is now included in DokuWiki 2009-02-14 (which confused me after upgrading, cos I initially thought the upgrade had broken subscriptions! LOL ). It's hardcoded to not send subscription emails to the editor of the page. If for some reason you want the old behaviour back (i.e. do get emails for your own edits), modify the call to subscriber_addresslist in inc/common.php so that the second parameter is true (the logic is inverted compared to the old workaround below).

Prevent Email Of Changes to Subscribed Author

You may wish to avoid sending emails to the author of the change, if the author is subscribed. Because- of course the author already knows that he/she made a change. I submit the below code change in order to work around this issue. It may be desirable to add a config flag for this setting. Possibly something each individual user can toggle for him/herself. At this point, it is on for everyone. ~Sherri W (www.start.ofitall.com).

In Detritus (& possibly older?) a change is needed to 'function notify()' in inc/common.php, to set 'self' to 'true':

diff -Naur common.php.orig common.php
--- common.php.orig
+++ common.php
@@ -1318,7 +1318,7 @@
     } elseif($who == 'subscribers') {
         if(!actionOK('subscribe')) return false; //subscribers enabled?
         if($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) return false; //skip minors
-        $data = array('id' => $id, 'addresslist' => '', 'self' => false, 'replacements' => $replace);
+        $data = array('id' => $id, 'addresslist' => '', 'self' => true, 'replacements' => $replace);
         trigger_event(
             'COMMON_NOTIFY_ADDRESSLIST', $data,
             array(new Subscription(), 'notifyaddresses')

davemidd 2015-09-14 11:32

Implementation Of Work-Around

/**
 * Return a string with the email addresses of all the
 * users subscribed to a page
 *
 * @param  string     $id					  Page id.
 * @param  boolean    $exclude_current_user   Indicates whether to skip the currently logged in user. To prevent email of your OWN changes to you.
 * 
 * @author Steven Danz <steven-danz@kc.rr.com>
 * @author (Workaround to skip current user) Sherri Wheeler (www.start.ofitall.com)
 */
function subscriber_addresslist($id, $exclude_current_user=false){
  global $conf;
  global $auth;
  global $USERINFO;

  $emails = '';

  if (!$conf['subscribers']) return;

  $mlist = array();
  $file=metaFN($id,'.mlist');
  if (@file_exists($file)) {
    $mlist = file($file);
  }
  foreach ($mlist as $who) {
    $who = rtrim($who);
    $info = $auth->getUserData($who);
    $level = auth_aclcheck($id,$who,$info['grps']);

    if(  $exclude_current_user && ($info['mail'] == $USERINFO['mail'])  ){	    
      continue;
    }

    if ($level >= AUTH_READ) {
      if (strcasecmp($info['mail'],$conf['notify']) != 0) {
        if (empty($emails)) {
          $emails = $info['mail'];
        } else {
          $emails = "$emails,".$info['mail'];
        }
      }
    }
  }

  return $emails;
}
...
$bcc  = subscriber_addresslist($id, true);	// Exclude current user (author of the changes).
...