0

Guys I have a module for sending e-mail, which when sending the e-mail is arriving with the html tags, example: br span, that is, it is not being interpreted. I think the code is read by php as a string and sent as text, but I don't know how to fix it. I've never developed an email trigger module before and I don't know what to do. I've tried using php htmlentities to convert to html but it didn't work. I need help to resolve please.

my controller

$SenderText = $post['text']; 

 $text = "<span>";

        foreach ($senderItens as $itens) {
            $text .= $itens . "<br>";
        }

        $text .= "</span>";



$sender = [
 'itens' => $text
]

->setTemplateVars([

 'itens' => $text  
])

what do i get

enter image description here

1 Answer 1

2

its very easy. in your email template just use like below

  {{var itens|raw}} 

this will fix your issue

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.