Ticket content with without html tags


is there any way to get only plain text from: “Content()”?
I tried with seeting Set($PreferRichText, 0); but did not change anything.

What I would like to get just new entered text, nothing more. Now I get like:

<div>asdasdasdasdasd<br /> <!-- This is the only part that I would need but without html tags -->
<br />
On Wed Jun 05 09:57:41 2019, root wrote:

If I anticipate your need correctly, you are asking about how you get plain text from RT via comment or correspond mail. This is in Templates ( https://your_rt_instance/rt/Admin/Global/Templates.html ). Remove the lines Content-Type: text/html in them and you should be OK.

$PreferRichText is only for viewing tickets through web gui.

I tried that but it is still the same. i still get “</br>” and so on.

I think the issue is that the quoted reply might actually be part of the content in the database, including the HTML mark up. If you want to remove that, you’ll need to do it yourself after you’ve got the content back from RT.


i remove quoted replay always and check what i get via Content().
is there any better way to remove this charactes and get just plain text?

Issue is also this that appostrov and etc are like:
This is from error log, and the some thing I get then in json.


Is the content type text/html or text/xml for these attachments? If so that’s correct - those look like HTML/XML entities. See the W3C list of common typographic entities.

this is exactly what i did. from what I can see it should be ok, I am waiting to get also conformation :slight_smile: