Replies: 1 comment
-
No, this is simply outside PHPMailer's responsibility. There are already many templating systems (Smarty, Twig, Blade, PHP itself, etc), and all of them will render to a string that will work just fine with PHPMailer. Just as PHPMailer avoids being an HTTP client, it's also not a templating system. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can we have a new function AddEmbeddedString to use for replace string in msgHTML ?
$mail->AddEmbeddedString('IANUARY 2022', 'MONTH_YEAR');
I want to avoid open-replace-save HTML Template and do this using PHPMailer.
<p>Invoice for <span style="color:#D23019">MONTH_YEAR</span> was release.</p>
Invoice for IANUARY 2022 was release.
$contents = file_get_contents ("emails/content_email.html");
$contents = str_replace(array('MONTH_YEAR'), array('IANUARY 2022'), $contents);
file_put_contents("emails/content_email.html", $contents);
Thank you
Beta Was this translation helpful? Give feedback.
All reactions