DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:betteremailnotifications

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:betteremailnotifications [2010-02-12 13:36] – checked and working with 2009-12-25c 158.64.4.15tips:betteremailnotifications [2011-12-10 00:25] (current) – Rincewind updates 74.93.109.180
Line 3: Line 3:
 This hack was in part inspired by the beautiful page change notifications sent out by other wiki software such as PBWiki, which uses HTML formatting instead of plain-text, and in part inspired by the existing diff rendering system in DokuWiki. I figured if DokuWiki is already capable of generating nicely formatted diff of page changes, I could tap into the system to send out HTML-formatted page notifications. This hack was in part inspired by the beautiful page change notifications sent out by other wiki software such as PBWiki, which uses HTML formatting instead of plain-text, and in part inspired by the existing diff rendering system in DokuWiki. I figured if DokuWiki is already capable of generating nicely formatted diff of page changes, I could tap into the system to send out HTML-formatted page notifications.
  
-**UPDATE:** +===== UPDATEs=====
   *  Instructions updated for DokuWiki 2008-04-11 RC2.   *  Instructions updated for DokuWiki 2008-04-11 RC2.
   *  edited hack for notification on new pages   *  edited hack for notification on new pages
   *  tested and working on DokuWiki 2008-05-05   *  tested and working on DokuWiki 2008-05-05
 +  *  tested and working on DokuWiki 2009-12-25c
 +  *  tested and working on DokuWiki 2011-05-25a
  
 ===== Screenshots of before and after ===== ===== Screenshots of before and after =====
Line 34: Line 36:
 </code> </code>
  
-at line 36 of an unmodified mail.php. Insert the following code just **above** the mail_send() function.+at line 36((Line 67 of Rincewind)) of an unmodified mail.php. Insert the following code just **above** the mail_send() function.
  
 <code php> <code php>
Line 106: Line 108:
 </code> </code>
  
-in the notify() function at line 877 of an unmodified common.php and insert the following code right **after** it:+in the notify() function at line 877((1148 Rincewind)) of an unmodified common.php and insert the following code right **after** it:
  
 <code php> <code php>
Line 186: Line 188:
  
 <code php> <code php>
-  mail_send($to,$subject,$text,$from,'',$bcc);+  mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc);
 </code> </code>
  
Line 200: Line 202:
  ***********************************/  ***********************************/
   if ($diffHTML) {   if ($diffHTML) {
-  mail_send_html($to,$subject,$text,$diffHTML,$_SERVER['REMOTE_USER']. ' <donotreply@INSERT-YOUR-SERVER-HERE.com>','',$bcc);+  mail_send_html($to,$subject,$text,$diffHTML,$conf['mailfrom'],'',$bcc);
   }else {   }else {
-  mail_send($to,$subject,$text,$_SERVER['REMOTE_USER']. ' <donotreply@INSERT-YOUR-SERVER-HERE.com>','',$bcc);+  mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc);
   }   }
 /*********************************** /***********************************
Line 223: Line 225:
 ==== That's all folks ==== ==== That's all folks ====
  
-That's it! We're done! Leave a message here or contact me at mail [dot] junjie [at] gmail [dot] com. If you have any way of intergrating this into a plugin, please do so and let us know here!+That's it! We're done! Leave a message here or contact me at mail [dot] junjie [at] gmail [dot] com. If you have any way of integrating this into a plugin, please do so and let us know here!
  
 ===== history ===== ===== history =====
Line 232: Line 234:
 ===== Questions and problems ===== ===== Questions and problems =====
   * The HTML version of the e-mail works fine in my web mail, but MS Outlook shows the plain text version.   * The HTML version of the e-mail works fine in my web mail, but MS Outlook shows the plain text version.
 +  * I tried this hack on version 2011-05-25a, it works, but does not support extended notification (digest and so on), one should look at extend inc/subscription.php
tips/betteremailnotifications.1265978199.txt.gz · Last modified: 2010-02-12 13:36 by 158.64.4.15

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki