XF 2.0 How to strip HTML entities from a variable?

Marcel

Active member
I have an addon that emails reports to our moderators. The report comes through fine from the template, but any characters appear as HTML entities.
For example :
Test report, I'm just checking the email function.

This is the relevant portion of the email template
<div>{{ bb_code_type('emailHtml', $message_content, 'post', $post) }}</div>

Is this something I should do in the template, or in the code beforehand?

Thanks
 
Try this:
Code:
<div>{{ bb_code_type('emailHtml', $message_content, 'post', $post) | raw }}</div>
 
Hi Arty

Thanks very much for your reply, but it's not changed the content of the email, still the same.
 
Just an FYI, this is the code that gets the report

Code:
$params = $handler->getContentForThreadReport($report, $message);
$messageContent = \XF::phrase('reported_thread_message', $params)->render('raw');
.
.
.
$templateParams = ['message_content' => $messageContent];
 
Top Bottom