This topic is locked
[SOLVED]

 send email with updated info only

9/17/2012 6:48:24 PM
PHPRunner General questions
S
stiven author

Hello everyone,
I was wondering if there is anyway that I could send an email with the information the user has updated, I mean with new info stored not all the rows in the table I just need to send all the new data that has been entered. These code works but it will email all the rows in the table even if no new data has been added.
thanks for your help



$email = "test@test.com";

$from = "Updated Information<test@test.com>";

$msg = "New Info Added to The System\n";

$subject = $values['first_name']." ".$values['middle_name']." ".$values['last_name']." [NEW INFO ADDED]";
global $pageObject;
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"];
Sergey Kornilov admin 9/17/2012
S
stiven author 9/17/2012

Thanks so much this solved my problem.



Check this article for inspiration:

http://xlinesoft.com/phprunner/docs/send_an_email_with_updated_fields_only.htm