[pmwiki-users] How to include diff in email notification?

Ryan Varick rvarick at gmail.com
Sun Dec 23 14:56:07 CST 2012

Thanks, the automatic change summary recipe was helpful. I was able to use
that to email the raw diff. For reference, here's what I'm doing:

  array_unshift($EditFunctions, 'ProvideDefaultSummary');
  function ProvideDefaultSummary($pagename,&$page,&$new)
    global $ChangeSummary, $DiffFunction;
    if ($ChangeSummary || !function_exists(@$DiffFunction)) return;
    $diff = $DiffFunction($new['text'], @$page['text']);
    $new['csum'] = $diff;

  $EnableNotify = 1;
  $NotifySquelch = 0;
  $NotifyDelay   = 0;

  $NotifyList[] = 'notify=myname at mydomain.com';
  $NotifyFrom   = 'notify at mydomain.com';
  $NotifySubjectFmt = '$FullName edited by $LastModifiedHost';
  $NotifyItemFmt    = "Edited \$PostTime \n\n \$PageUrl?action=diff \n\n
  $NotifyBodyFmt    = '$NotifyItems';

On Sun, Dec 23, 2012 at 12:47 AM, Petko Yotov <5ko at 5ko.fr> wrote:

> Ryan Varick writes:
>> I'm using the Notify script[1] to notify me when someone anonymously
>> edits my personal wiki. I would like to include the diff in email, but I
>> cannot figure out how to do so. I am currently using plaintext email
>> notifications, so I would prefer a plaintext diff, but it would also be
>> nice to know how to send an HTML diff too.
> This recipe may probably be used or adapted:
>   http://www.pmwiki.org/wiki/**Cookbook/**AutomaticChangeSummary<http://www.pmwiki.org/wiki/Cookbook/AutomaticChangeSummary>
> Some stuff I use, not to include the diffs in notifications, but to more
> easily click on a diff link :
>   http://www.pmwiki.org/wiki/**Cookbook/TrackChanges<http://www.pmwiki.org/wiki/Cookbook/TrackChanges>
>   http://www.pmwiki.org/wiki/**PITS/01171<http://www.pmwiki.org/wiki/PITS/01171>
> Petko
> ______________________________**_________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/**mailman/listinfo/pmwiki-users<http://www.pmichaud.com/mailman/listinfo/pmwiki-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20121223/61a80c8d/attachment.html>

More information about the pmwiki-users mailing list