This topic is locked

Email to event

6/29/2006 1:13:27 AM
PHPRunner General questions
M
maxcolo author

Sorry for my english but i italian

Is possible to do so that when a consumer sees a record, arrivals an email to the email of the seen record?

Example I see the record of Giovanni and it reach an email Giovanni. With a message "your record has been seen."

Alexey admin 6/29/2006

Hi,
sure, you can do this using View OnLoad event.

Here is the sample code:

function ViewOnLoad($where)

{
// Parameters:

// $where - string with WHERE clause pointing to record to be viewed

//** Send email with old data record ****

global $conn,$strTableName;

$subject="Put your subject here";
// modify the following SQL query to select fields you like to send

$rs = db_query("select * from " . $strTableName ." where ". $where,$conn);
if($data=db_fetch_array($rs))

{

mail($data["Email"], $subject, "your record has been seen");

}
}



where Email is your actual field name with email address.

M
maxcolo author 6/30/2006

Grazie, provo subito

Massimo