Skip to content
Snippets Groups Projects
Commit 30d7d718 authored by Mike Frysinger's avatar Mike Frysinger
Browse files

allow dynamic e-mail "from" addresses when doing notification

this patch allows you to use @USER@ / @NAME@ / @MAIL@ in the "from" address
when sending a mail notification e-mail

darcs-hash:20061205201957-5224c-5637d6412106cb16af8817f07c8c02e95e4b3088.gz
parent 3d3c095d
No related branches found
No related tags found
No related merge requests found
......@@ -810,6 +810,7 @@ function saveOldRevision($id){
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'){
......@@ -866,7 +867,12 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){
$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);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment