Put this code into “Email_Sending” server event that belongs to the “PX_2020” table:
if (CurrentPageID() == “edit”) { // If Edit page
$email->Subject = "PX_2020 record(s) updated by " . $args[“rsnew”][“username”]; . " of " . $args[“rsnew”][“department”]; // Change subject, assume “username” and “department” fields exists in the current table
}
Do I replace this code that is in there, or where should I put that code
if (CurrentPageID() == “edit”) { // If Edit page
$email->Subject = "PX_2020 record(s) updated by " . $args[“rsnew”][“username”]; . " of " . $args[“rsnew”][“department”]; ; // Change subject, assume “username” and “department” fields exists in the current table
}
if (CurrentPageID() == “edit”) { // If Edit page
$email->Subject = "PX_2020 record(s) updated by " . $args[“rsnew”][“username”]; . " of " . $args[“rsnew”][“department”]; // Change subject, assume “username” and “department” fields exists in the current table
}
What is the meaning of each piece of the code below?
That is a server event that you can use to change the default content/subject/recipient of the email if you enable one/some options under “Table” setup → “Email Notification”.
if (CurrentPageID() == “edit”) { // If Edit page
$email->Subject = "PX_2020 record(s) updated by " . $args[“rsnew”][“username”]; . " of " . $args[“rsnew”][“department”]; // Change subject, assume “username” and “department” fields exists in the current table
}
$email->Subject = "PX_2020 record(s) updated by " . $args[“rsnew”][“username”]; . " of " . $args[“rsnew”][“department”]; // Change subject, assume “username” and “department” fields exists in the current table
You have extra “;”. During development you better enable error in php.ini, see:
if (CurrentPageID() == “edit”) { // If Edit page
$email->Subject = “Player record of " . $args[“rsnew”][“FirstLast”] . " on " . $args[“rsnew”][“Email”] . " on " . $args[“rsnew”][“Phone”] . " Updated” ;
$email->Body = "Player record of " . $args[“rsnew”][“FirstLast”] . $args[“rsnew”][“Team_2020”] . $args[“rsnew”][“TeamID”] . " Updated by: " . CurrentUserName() ;
}
return TRUE;
}
Everything shows up correctly except $args[“rsnew”][“Team_2020”] . $args[“rsnew”][“TeamID”]
is there something that I am missing? these are all in the same record and the fields are listed in their correct case. Is it possible that the underscore in Team_2020 is messing it up?