HTML Emails - Cant use variables
Permalink
Hello, I am using the standard send mail function and sending HTML emails. This work fine, however, when i try and add a variable to the mail body using %s, the html mail fails and throws back an error.
If i take all tags out of the html email with "" such as <table width=""> - it works fine.
Is there a way round this by wrapping the %s in something or similar..?
E.g
If i take all tags out of the html email with "" such as <table width=""> - it works fine.
Is there a way round this by wrapping the %s in something or similar..?
E.g
$mh = Loader::helper('mail'); $mh->to('email.com); $mh->from('email.com'); $mh->addParameter(‘uName’, ‘name’); $mh->load('book_viewing'); $mh->sendMail(); in book viewing template <?php $subject = t('my subject'); $bodyHTML = t(' <table width="590"> <tr><td>text here and %s </td></tr> </table> ', $uName );