Hello
you want to send an email via Phpmaker to a speicific recipient with the contents of the entire rsnew array inside. So all the fields actually edited. Can I do that?if (CurrentPageID() == “edit”) {
$Email->Sender = “test@test.com”;
$Email->Recipient = “test@test.com”; // Change recipient to a field value in the new record
$Email->Subject = "test"; // Change subject
$Email->Content = $Args[“rsnew”][“City”];
$Email->Send();
now I’m only able to print and send the email with a newly edited field if I know the reference field. But I would like to send this email with all the fields that have been modified.Thanks!
You may compare the rsold and rsnew. You may refer to the method writeAuditTrailOnEdit() in the template or in generated script (if you have enabled audit trail on edit) on how to compare.
In order to see the generated code in writeAuditTrailOnEdit() function, then you need to enable “Audit Trail” from “Table” setup → “Audit Trail”, and then re-generate ALL the script files again, and then see the code in that writeAuditTrailOnEdit() function from the generated phpfn.php file (assume you’re using v2020). In v2020, the Audit Trail functions are simplified by using “WriteAuditTrail” function. See the related code from the generated phpfn.php file.