I have a PHP code which sends an email with HTML template. HTML template has some PHP variable like Name, Email, etc.
<strong>Name: {name} </strong>
because email template has more code, I include it in my PHP file
$htmlInvoice = file_get_contents($_SERVER["DOCUMENT_ROOT"] .'/mail/invoice.html');
$name= $user['name']);
$msg = $htmlInvoice;
But when an email sent, it can not read variables inside the
HTML file. and for example echo $name like a text
$htmlInvoice, such as string replacement.