Send email with old data record action allows, upon changing the record, emailing the previous data.
You can edit several parameters: the text and the subject of the message, the sender and recipient email addresses.
Available in the following events:
•Edit page: Before record updated
•Edit page: After record updated
•List page: Before record deleted
Note: To use this action, you have to set up the Email settings. Press button on the toolbar or write the code manually.
Note: To specify which table fields to email, edit the values assigned to $msg variable.
//********** Send email with old data ************
$email="test@test.com";
$from="admin@test.com";
$msg="";
$subject="New data record";
$msg.= "Name: ".$oldvalues["name"]."\r\n";
$msg.= "Email: ".$oldvalues["email"]."\r\n";
$msg.= "Age: ".$oldvalues["age"]."\r\n";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
See also:
•Send an email with attachment
•Send an email to selected users
•How to email selected records as separate PDF files