I’ve just written a trigger for notify the users about ticket updates.
A a first step I used the following:
{article.body} and the notification email contains quotations marks in every line (like the documentation said).
After some discussion we decided to use {artcile.body_as_text.text2html} to remove the quotation marks.
"
Variable: #{article.body_as_text.text2html}
Body as plain text, converted to HTML without quote character (>).
"
But:
The quotation marks are still there.
Do we need some additional packages to use this variable? Is this a known issue with this varible?
Used Zammad version: zammad-7.1.3-1787744200.e0d0086.el9.x86_64
Used Zammad installation type: rpm package
Operating system: Alma Linux 9
Browser + version: Firefox 154.0
Expected behavior:
quotations marks removed
Actual behavior:
quotation marks not removed
Steps to reproduce the behavior:
change #{article.body} to #{article.body_as_text.text2html}
Thanks, but the result is same with #{created_article.body_as_html}.
At this stage, I wouldn’t rule out the possibility that there is a problem with my system. I would expect that other users would otherwise be reporting similar issues.
However, as the server is new and we use the standard set of rules on other systems as well, I would be interested to know where the problem is occurring.
I’ve tested all 4 options.
{article.body} - Body in plain text, converted to HTML with quote character (>) at the beginning of each line.
{article.body_as_html} - Body as HTML without quote character (>).
{article.body_as_text.text2html} - Body as plain text, converted to HTML without quote character (>).
{article.body_as_text} - Body as plain text without quote character (>).
and:
{article.body} works as expected → with quotation
{article.body_as_text} works also as expected → without quotation
I got a wild theory but i’m not a software developer and my lunch break is over now so i can’t look into details, maybe someone else can take a look to see if my suspicion seems reasonable:
# blockquote handling
string.gsub!(%r{<blockquote(| [^>]*)>(.+?)</blockquote>}m) do
"\n#{$2.html2text(true).gsub(%r{^(.*)$}, '> \1')}\n"
end
this is part of Zammad’s way of formatting outgoing mail but it only affects the HTML tag <blockquote>
Now, i don’t know if your setup might somehow include these tags in your emails, but that would, in my opinion, at least partly explain why your behavior is so different from other people’s.
Your code snippet gave me a starting point for my search. I’m not a programmer, but I do understand a bit about code, and my first thought was to have a look at the requirements.
The line “require ‘rchardet’” was my starting point.
I couldn’t find an ‘rchardet’ library on my system. A quick search turned up a ruby package.
The package was installed with a number of Ruby dependencies.
A renewed attempt using body_as_text.text2html now produces the desired result.
This raises the question for me as to why the dependencies are not defined in the RPM. The installation documentation does not list any requirements in this regard either.
I’m now wondering whether there are any other required libraries that I might stumble across by chance.
body_as_html returns the HTML body unchanged, so the > can’t come from the variable. Can you check the raw source of the received mail? If the > are only in the plain-text part, your client is just showing that part.
Thanks for the clarification.
If I deinstall the ruby package, I can reproduce the old behavior and the quote character is shown again.
I can not see any error message in the logfile so I have no idea what is happening.