Working with a phpmailer function, having to format the email inside a variable with double quotes is becoming a nightmare.
$body = "<div><h1>Hello, ".$foo."!</h1></div>";
It's like this for the entire body of the email, which is extensive, and gets hard to troubleshoot as my editor (KomodoEdit) doesn't recognize syntax errors and such which the markup is defined within a string.
I've been looking into other ways of accomplishing this such as the heredoc method, but while this looks cleaner, it still doesn't allow me the utility of my editing software's syntax check and tag collapsing.
My next step was to try something like this:
body.php
<div><h1>Hello, $foo !</h1></div>
index.php
error_reporting(E_ALL);
$foo = 'Frank';
$page = include('body.php');
$body = <<<EOD
$page
EOD;
But this doesn't post anything and I don't even get any errors reported. I've been through the manual but am either missing something in the syntax or it's a logical error where <<<EOD is to be used.