This topic is locked
[SOLVED]

 Send email with new data

11/21/2013 1:30:32 AM
PHPRunner General questions
Z
Zaboor author

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

C
cgphp 11/21/2013

In the "After successful login" event, use the $data array to access the email value:



$_SESSION["Email"] = $data["Email"];
Z
Zaboor author 11/23/2013

Thank you so much.