Jump to content

How to remove HTML tags from plain text email?

Featured Replies

Posted

I need to strips html tags from the $content in a plain text email template.

I try to use strip_tags but I got a

syntax error, unexpected '$return' (T_VARIABLE)

 

28 minutes ago, InvisionHQ said:

I try to use strip_tags but I got a

How are you do it?

I think something like

{{strip_tags($content->content())}}

Use 

{{$txt = strip_tags($content->content());}}
{$txt}

or

{expression="strip_tags($content->content())"}

or

{expression="\IPS\Email::buildPlaintextBody($content->content())"}

 

  • Author

I do it with:

{{$plaincontent = strip_tags($content)}}

...I missed the " ; " at the end....  :no:

Thank anyway.

There is a striptags template tag you can use, although the way you are doing it works fine as well.

{striptags="$content"}

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.