This topic is locked

Emailing Auto Increment Field

3/27/2013 12:16:40 PM
PHPRunner General questions
R
rustler45 author

I am trying to send an email, after adding a record, that has an auto-increment field, "NewContractNum". I want to include this field in my email and have put the following in the After Record Added event. I used the $keys hoping that would allow me to email this field but it doesnt work. What am I doing wrong?
$email=$values["E-mail Address"];

$from="Factory Assurance Southwest";

$msg="Your New Contract has been sent."."\r\n"."\r\n";

$subject="New FAS Contract Submitted";
$msg.="Contract #: ".$keys['NewContractNum']."\r\n";

$msg.="Status: ".$values['Status']."\r\n";

$msg.="Dealer: ".$values['Company']."\r\n";

$msg.="Dealer #: ".$values['DealerNumber']."\r\n";

$msg.="Email: ".$values['E-mail Address']."\r\n";

$msg.="Customer: ".$values['CustomerName']."\r\n";

$msg.="Coverage: ".$values['Coverage']."\r\n";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];
thanks,

Rusty

C
cgphp 3/27/2013

Make sure the NewContractNum field is set as key column in PHPrunner (http://xlinesoft.com/phprunner/docs/edit_page_settings.htm), otherwise use $values['NewContractNum']

R
rustler45 author 3/27/2013

I checked to make sure that I had NewContractNum set as the key column in PHP and it is. I also had already tried using $values['NewContractNum'] but that didnt work. That why I changed it to $key thinking that was the proper way since $values didnt work. I cant figure out what I am doing wrong.

C
cgphp 3/27/2013

Enable firebug and check if you get any error.