I have the following email generated automatically. When it is triggered and I am sent an email, I only get “MESSAGE PART 1”. The if statement, and everything after the if statement (including REST OF MESSAGE) never gets sent. How can this be done?
/*----SEND EMAIL TO STUDENT----*/
$to = $studentEmail;
$subject = 'Title';
$message = 'Dear '.$studentFirstName.',
MESSAGE PART 1';
if ($bubbleWrap == true) {
'Bubble Wrap ($5)';
}
'REST OF MESSAGE';
$headers = 'From: CustomerService@GuysAndDollies.com' . "\r\n" .
'Reply-To: customerservice@GuysAndDollies.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
You need to concatenate the remaining strings with the original:
Currently you just have two string literals which will do absolutely nothing on their own.