Support

Akeeba Ticket System

#27150 Reply by email not working with some email clients, due to invalid HTML

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by weeblr on Friday, 17 February 2017 04:43 CST

weeblr
 Hi

We have had a few customers for whom reply by email was not working. As I started using a new email client (mailbird), I realized this was not working for me any longer either.
As I could reproduce, I investigated and found that it comes down to the html message being sent by ATS being invalid, and thus being stripped by the client when hitting the Reply button. As the the user response misses the "Reply above this line" line, the ticket is not recognized (if the X-ATS-TICKETID header is also removed, which seems common).

This happens because the PLG_ATS_POSTEMAIL_REPLYABOVE string is simply prepended to the email template:
$body       = '!-!- ' . JText::_('PLG_ATS_POSTEMAIL_REPLYABOVE') . ' ' . $ticketInfo . ' -!-!';
$body       = '<p>' . $body . '</p>';
$template   = $body . $template;


And so we end up with a message similar to:
<p>!-!- You can reply above this line {ticketid:3298} -!-!</p>
<html>
<head>
<title>Your new private ticket #3298 Test ticket with reply by=
 email</title>
</head>
<body><div style=3D"background-color: #f3f3f5; padding: 30px 20px;">

So the Reply above... line is outside of the html tag, and is stripped. I got this working by inserting the Reply above... line just after the body tag:
//$body       = '<p>' . $body . '</p>';
//$template   = $body . $template;
$template = str_replace(
	'<body>',
	'<body><p>' . $body . '</p>',
	$template
);


We only send HTML, and this is fine for us. I suspect you might want to check first for the presence of the body tag, in case admin selected to send text-only messages (in such case, the previous way of appending only is fine).

The resulting HTML message is no longer stripped when using the Replt button and is recognized by ATS as pertaining to a ticket.

Rgds

tampe125
Akeeba Staff
Hello,

thank you very much for the report.
I just fixed the issue, can you please download the latest dev release and try again?

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr
Hi Davide

Tried 0CBFF, but problem is the same. I then checked the code, and the PostEmail plugin has not been modified, still:

$template = $body . $template;

??

nicholas
Akeeba Staff
Manager
I uploaded from the wrong branch. The correct one is revE9AF630 which I just uploaded now.

Nicholas K. Dionysopoulos

Lead Developer and Director

๐Ÿ‡ฌ๐Ÿ‡ทGreek: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: excellent ๐Ÿ‡ซ๐Ÿ‡ทFrench: basic โ€ข ๐Ÿ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr
Hi again

Yes, that fixes it for me.

Do you have a change log of this version agains the released 2.3.3? or is it just a branch off 2.3.3?
I tested on staging, not the main site yet.

Rgds

tampe125
Akeeba Staff
This is the current Changelog. Please remember that this is an alpha version and things could change before the stable release.
Akeeba Ticket System 2.2.4
================================================================================
# [MEDIUM] Could not add replies to a Ticket Bucket
# [LOW] Fixed displaying assigned user while viewing tickets in Buckets page
# [LOW] Fixed error in Social Buttons plugin
# [LOW] Multi-language sites: Fixed choosing the category while creating a new ticket
# [LOW] Reply by email: Fixed broken HTML while adding the "Reply above this line" text

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Thanks, I'll just wait til there's a release then.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!