This topic is locked
[SOLVED]

 sending an email from the database on record submit

2/8/2011 1:44:40 PM
PHPRunner General questions
R
rlee6087 author

I have created a small trouble ticket application, when the operator enters a trouble ticket, I would like the application to send an email to the customer notifying them that the request was received. I'm trying to make this happen on the save button and not adding another button to the page. I am trying to get it toread the email address from the database. I'm using phprunnerpro enterprise with mysql. the tables and fields are as follows
table name = tickets

id field = customer id

email address field = customer_email
the message and subject will be static, so thats easy. any help at all would be greatly appreaciated. thank you

T
trek46 2/8/2011

Put this in the After Record Added event:



// ********** Send simple email ************
$email="$values[customer_email]";
$from="admin@test.com";
$msg="Hello there\nBest regards";
$subject="Sample subject";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];



I hope that helps get you on your way!
trek46



I have created a small trouble ticket application, when the operator enters a trouble ticket, I would like the application to send an email to the customer notifying them that the request was received. I'm trying to make this happen on the save button and not adding another button to the page. I am trying to get it toread the email address from the database. I'm using phprunnerpro enterprise with mysql. the tables and fields are as follows
table name = tickets

id field = customer id

email address field = customer_email
the message and subject will be static, so thats easy. any help at all would be greatly appreaciated. thank you

R
rlee6087 author 2/8/2011

Thanks so much Trek46, it worked perfectly. I really appreaciate it! You ROCK!!