Go to the FreeLists Home Page Home Signup Help Login
 



Browse dokuwiki: This Month's ArchiveMain Archive PageRelated postsPrevious by DateNext by Date

[dokuwiki] [patch] allow dynamic e-mail "from" addresses when doing notification

  • From: Mike Frysinger <vapier@xxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 4 Dec 2006 20:19:51 -0500
this patch allows you to use @USER@ / @NAME@ / @MAIL@ in the "from" address 
when sending a mail notification e-mail
-mike
--- old-dokuwiki/inc/common.php 2006-12-04 20:19:40.000000000 -0500
+++ new-dokuwiki/inc/common.php 2006-12-04 20:19:40.000000000 -0500
@@ -800,6 +800,7 @@
 function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){
   global $lang;
   global $conf;
+  global $INFO;
 
   // decide if there is something to do
   if($who == 'admin'){
@@ -856,7 +857,12 @@
   $text = str_replace('@DIFF@',$diff,$text);
   $subject = '['.$conf['title'].'] '.$subject;
 
-  mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc);
+  $from = $conf['mailfrom'];
+  $from = str_replace('@USER@',$_SERVER['REMOTE_USER'],$from);
+  $from = str_replace('@NAME@',$INFO['userinfo']['name'],$from);
+  $from = str_replace('@MAIL@',$INFO['userinfo']['mail'],$from);
+
+  mail_send($to,$subject,$text,$from,'',$bcc);
 }
 
 /**

Other related posts:

  • [dokuwiki] [patch] allow dynamic e-mail "from" addresses when doing notification
  • [dokuwiki] Re: [patch] allow dynamic e-mail "from" addresses when doing notification




  • [ Home | Signup | Help | Login | Archives | Lists ]

    All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
    Everything else ©2008 Avenir Technologies, LLC.