|raw filter not working in email template

I’m trying to use the |raw filter in my email template but it doesn’t seem to be working. It just shows the html tags as text. Is there something I’m missing? I swear it worked in previous versions of OctoberCMS?

as long as i know, email templates are strictly markdown, or? then u need to use |md

@snipi it looks like it’s possible to use |raw

Using the code above, it will attempt to load the layout content from the path plugins/acme/blog/views/mail/custom-layout.htm and these contents are an example.

<html>
<body>
    <h1>HTML Contents</h1>
    <div>
        {{ content|raw }}
    </div>
</body>
</html>

@ndcisiv feel like the email is either read as plain-text or sent as plain-text.

What your mail function looks like ? Could the client you are using to read emails read the email as plain-text ?

I have multiple sites in v2 that use the raw filter in email templates, both within the ‘views/mail’ folder inside of components as well as templates created in the backend. I’ve tried both methods in v3 and neither are working, they display the html code. It is not a plain-text issue, as html code within the template itself is rendering just fine as html, it is only the html code within the variable being passed into the template itself. I’m not sure what has changed or what I may be missing in v3.

Try wrapping the code in a div. That fixed it for me when it wasn’t working

This solved it for me too.

I only saw the first line of my HTML content.

I checked to see if the | md filter was the culprit, but it wasn’t the case.

Wrapping it in a div solved the issue! Thanks!

Nothing seemed to be working for any of these options. I ended up deleting the template and re-created it, and clearing Octobers cache and it just started working. Not sure where it was getting hung up but it’s working now. Appreciate the ideas to try! Thanks.