This topic is locked

Email Report of add event to email in the add record event

6/18/2006 12:30:50 PM
PHPRunner General questions
B
brannen author

I want to email a report of add event to email in the add record event. Is this possible?
HELP!!!

J
Jane 6/19/2006

Hi,
you can do it using events on the Event tab (step 11) in PHPRunner.

Select Before record added event and choose Send email with new data action.

Here is a sample code for this event:

function BeforeAdd(&$values)

{
// Parameters:

// $values - Array object.

// Each field on the Add form represented as 'Field name'-'Field value' pair
//** Send email with new data ****
$email="test@test.com";

$message="";

$subject="New data record";
foreach($values as $field=>$value)

$message.= $field." : ".$value."\r\n";
mail($email, $subject, $message);
return true;
// return true if you like to proceed with adding new record

// return false in other case
}