I'm trying to create an email automation using PHP. Originally I had this:
function send_email($email) {
$message = "Hello! Here is an email message";
mail($email, "Subject Line", $message, "from: [email protected]");
}
However I want to make the message emailed much longer and include some HTML markup (simple h1's and p tags).
I'm new to PHP but have been OK finding information on how to output PHP in HTML, but not how to include HTML within a PHP variable. I need to be able to store the markup inside $message.
And another thing I can't get my head around. If I want to write words like don't in my HTML, then I can't use a "'" to open and close. I must use " instead. Is this correct?
ETA: Is there anyway to instead send an entire HTML file via this function? So I could create a nice looking template for the email instead and just send that .html file via email.