Hello,
I have an inline add form that contains a field called Email. I am wanting to send an email notifying the email address inputted that they have been added. I am using an Before Record Added event to do this. I am having trouble passing the '".$values["Email"]."' to the $emails. Does anyone see my error?
Thank you!
//** Send email with new data ****
$emails='".$values["Email"]."';
$from="info@mysite.com";
$msg="You have been added to a team!";
$subject="Hi! You've Been Added!";
$ret=runner_mail(array('to' => $emails, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
//** Check if specific record exists ****
global $conn;
$strSQLExists = "select * from memusers where Email='".$values["Email"]."'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
return true;
}
else
{
//** Insert a record into another table ****
$strSQLInsert = "insert into memusers(Email, Username, AccessType, Password, Beginpay, Endpay, Paypal) values ('".$values["Email"]."','".$values["Name"]."','".$values["AccessType"]."', 'UKcg75','2008-1-1', '2008-1-1', '1')";
CustomQuery($strSQLInsert);
return true;
}
return true;