I have a responsive email template in a php file and trying to send it with PHP mailer with no success. My code looks like this.
$m = new PHPMailer;
$m ->isSM
This isn't anything to do with it being responsive - that's just a matter of using the CSS media queries in the Zurb CSS, it doesn't need any javascript.
The problem you're seeing is that file_get_contents
literally gets the contents of the file, it does not run it as a PHP script. There are several ways to solve this.
You can include
the file while assigning it to a variable, like this:
$body = include 'functions/register-email.php';
$m->msgHTML($body, dirname(__FILE__));
The problem with this approach is that you can't just have content sitting in the file, you need to return
it as a value, so your template would be something like:
$headline