I have a page devised on my site which creates an email which is then sent using PHP's sendmail function. The email consists of a standard "header" text, and also a standard "footer" text.
I have also got four checkboxes on the page, which, depending on whether they are clicked or not, will insert four chunks of text in the middle part of the email.
Initially I have been trying the following... The required elements are $msg_header and $msg_footer and the optional elements are $msg_check1, $msg_check2, $msg_check3 and $msg_check4 - I tried a few "show if checkbox = true" snippets, but I just couldn't do it! Help please...!
$email = "email@example.com";
$from_header = "From: Our Site Name <firstname.lastname@example.org>";
$subject = "Our Subject";
$msg_header = "Dear " . $firstname . ",\n\n
This is the header text!\n\n";
$msg_check1 = "This is the optional text for checkbox 1\n\n\";
$msg_check2 = "This is the optional text for checkbox 2\n\n\";
$msg_check3 = "This is the optional text for checkbox 3\n\n\";
$msg_check4 = "This is the optional text for checkbox 4\n\n\";
$msg_footer = "This footer!\n\n";
$message = $msg_check1 . $msg_check2 . $msg_check3 . $msg_check4";