I want to be send e-mail to the user contains the data that has been modified.
The e-mail field is in users table so I try to get the e-mail by "After successful login" Event
$_SESSION["Email"] = $values["Email"];
and in "Before record updated" Event
$email=$_SESSION["Email"]
$from="admin@test.com";
$msg="";
$subject="New data record";
foreach($values as $field=>$value)
{
if(!IsBinaryType($pageObject->pSet->getFieldType($field)))
$msg.= $field." : ".$value."\r\n";
}
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
It does not work and editing can not be saved
Is there a mistake?
What's the correct way?
Thanks
Zaboor