Posted on: 06/12/05 10:48pm
By: Anonymous (FreakWorld)
Posted on: 06/13/05 02:10am
By: machinari
if (!empty ($A['fullname'])) { $to = COM_formatEmailAddress ($A['fullname'], $A['email']); } else { $to = COM_formatEmailAddress ($A['username'], $A['email']); }
if($uid != 2){ if (!empty ($A['fullname'])) { $to = COM_formatEmailAddress ($A['fullname'], $A['email']); } else { $to = COM_formatEmailAddress ($A['username'], $A['email']); } } elseif ($uid == 2){//if mail is being sent to admin/root $to = ''; //get user ids of group 'root' $result = DB_query("SELECT ug_uid FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id='1'"); if(DB_numRows($result) >= 1){ //for each of your admins add their email addy to $to //i think mail.php can take an array or list of comma separated recipients... while($A = DB_fetchArray($result)){ $Bresult = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = {$A['ug_uid']}"); $B = DB_fetchArray($Bresult); if (!empty ($B['fullname'])) { $to .= ',' . COM_formatEmailAddress ($B['fullname'], $B['email']); } else { $to .= ',' . COM_formatEmailAddress ($B['username'], $B['email']); } } } }
Posted on: 06/13/05 02:13am
By: machinari
Posted on: 06/14/05 02:03am
By: Anonymous (FreakWorld)
Posted on: 06/14/05 08:17pm
By: Anonymous (FreakWorld)
Posted on: 06/14/05 08:25pm
By: Anonymous (FreakWorld)
Posted on: 06/14/05 08:32pm
By: machinari
Posted on: 06/14/05 11:57pm
By: machinari
return $formatted_name . ' <' . $address . '>';in function COM_formatEmailAddress() in lib-common.php and add a semicolon just after the address like this:
return $formatted_name . ' <' . $address . '>;';
Posted on: 06/15/05 01:18am
By: Anonymous (FreakWorld)
Posted on: 06/15/05 05:06am
By: machinari
while($A = DB_fetchArray($result,false)){now it should not go over each admin twice--i'm assuming that it was adding an address for the index and then again for the assoc.
Posted on: 06/15/05 11:19am
By: Anonymous (FreakWorld)
Posted on: 06/15/05 11:36am
By: Anonymous (FreakWorld)
Posted on: 06/17/05 12:17am
By: Anonymous (FreakWorld)
Posted on: 06/23/05 06:13am
By: Mikez
Posted on: 06/23/05 04:33pm
By: machinari
if($uid != 2){ if (!empty ($A['fullname'])) { $to = COM_formatEmailAddress ($A['fullname'], $A['email']); } else { $to = COM_formatEmailAddress ($A['username'], $A['email']); } } elseif ($uid == 2){//if mail is being sent to admin/root $to = array(); //get user ids of group 'root' $resultA = DB_query("SELECT ug_uid FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id='1'"); if(DB_numRows($resultA) >= 1){ //for each of your admins add their email addy to $to //i think mail.php can take an array or list of comma separated recipients... while($A = DB_fetchArray($resultA)){ $resultB = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = {$A['ug_uid']}"); $B = DB_fetchArray($result; if (!empty ($B['fullname'])) { $to[] = COM_formatEmailAddress ($B['fullname'], $B['email']); } else { $to[] = COM_formatEmailAddress ($B['username'], $B['email']); } } } }
Posted on: 06/25/05 09:48pm
By: machinari
Posted on: 06/26/05 03:29am
By: Mikez
Posted on: 06/26/05 12:15pm
By: Mikez
Posted on: 06/26/05 12:22pm
By: dewdoo
Posted on: 06/26/05 12:46pm
By: machinari
Posted on: 06/26/05 02:36pm
By: dewdoo
Posted on: 06/26/05 03:15pm
By: machinari
COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);insert a few lines and edit that line as well to take the array--like this:
$to = array(); //get user ids of group 'root' $resultA = DB_query("SELECT ug_uid FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id='1'"); if(DB_numRows($resultA) >= 1){ //for each of your admins add their email addy to $to //mail.php can take an array or list of comma separated recipients... while($A = DB_fetchArray($resultA)){ $resultB = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = {$A['ug_uid']}"); $B = DB_fetchArray($result; if (!empty ($B['fullname'])) { $to[] = COM_formatEmailAddress ($B['fullname'], $B['email']); } else { $to[] = COM_formatEmailAddress ($B['username'], $B['email']); } } } COM_mail ($to, $mailsubject, $mailbody);you can take this further and throw a setting in config.php that will be checked to see if you want notifications to go to admin only or the moderator or group thereof.
Posted on: 06/26/05 05:16pm
By: dewdoo
Posted on: 06/26/05 11:20pm
By: Mikez