I'm trying to render a php file and then return it as html to send in an email, how would I go about doing this? Here is an example of the code that I'm using:
public function setPHP($php)
{
ob_start();
$phpsend = ( include $php );
$this->html = (string) ob_get_contents();
ob_end_clean();
}
Here is how I'm calling the function.
$php = file_get_contents( NHM_PLUGIN_DIR . 'assets/templates/newhomesguide.php' );
$css = file_get_contents( NHM_PLUGIN_DIR . 'assets/css/email_template.css' );
$cssToInlineStyles->setPHP($php);
$cssToInlineStyles->setCSS($css);
I'm trying to modify CSSToInlineStyles by Tijs Verkoyen, which inlines css with html, I'm just trying do do the same but with a php file that has functionality.