I have been requested to change the format of the email that is sent to confirm receipt of the request.
The section in the php file that I think adds the text to the body of the email seems to run through the array and each cell entry is added as a new line of text.
What I need to do is add certain lines in as a specific section.
For example I need to have all sales person details in a section at the top of the email, then a couple of empty lines, a dotted line, then a couple of spaces then another section which might be about the person they are looking to meet with, then another break and then another section and so on. Probably be about 5 sections to do this for.
The code I think is being used at the moment does not seem to allow for this formatting and is below.
Any help would be appreciated. Also if more info is need please just ask and I will provide.
Code: Select all
function BeforeAdd(&$values,&$message,$inline)
{
//********** Send email with new data ************
$email=$values["**********_Email"];
$from=$values["**********_Email"];
$cc="*********@********************.com";
$link = mysql_connect("www.***************.com", "**********", "***********");
mysql_select_db("request_mtg", $link);
$result = mysql_query("SELECT * FROM ******************", $link);
$rows = mysql_num_rows($result);
$lastID=$rows + 1;
//$lastID=mysql_query($rows) + 1;
$msg="If you have any questions, please contact ****** ********* at *****@*************.com or by phone at *******************.\n\nMeeting ID: $lastID.\n";
$subject="Meeting Request ID ".$lastID.", ".$values["Operator"].", ".$values["Target1_Contact_Surname"];
foreach($values as $field=>$value)
{
if(!IsBinaryType(GetFieldType($field)))
$msg.= $field." : ".$value."\r\n";
}
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from' => $from, 'cc' => $cc));
if(!$ret["mailed"])
echo $ret["message"];
return true;
;
} // function BeforeAdd