J
|
Jane 10/23/2006 |
Graeme, function BeforeAdd(&$values) { $email=""; $message=""; $subject="New data record"; foreach($values as $field=>$value) $message.= $field." : ".$value."\r\n"; global $conn; $str = "select * from users where GroupID='".$_SESSION["GroupID"]."'"; $rs = db_query($str,$conn); while($data = db_fetch_array($rs)) { mail($data["email"], $subject, $message); } return true; }
|
G
|
gdude66 author 10/24/2006 |
Graeme, Sure you can do it using BeforeAdd event. Here is a sample code: where email is your actual field name.
|
J
|
Jane 10/24/2006 |
Graeme, function BeforeAdd(&$values) { $email=""; $message=""; $subject="New data record"; foreach($values as $field=>$value) $message.= $field." : ".$value."\r\n"; global $conn; $str = "select * from users where GroupID='".$values["GROUPID"]."'"; $rs = db_query($str,$conn); while($data = db_fetch_array($rs)) { mail($data["email"], $subject, $message); } return true; } |
G
|
gdude66 author 10/24/2006 |
Graeme, if you want to send emails to all users of entered GroupID (GroupID is filled on the ADD page) change this code in the following way:
|
G
|
gdude66 author 10/28/2006 |
OK thanks I think I have a handle on that. |
![]() |
Alexey admin 10/30/2006 |
Graeme, |