jbostoen / itop-jb-mail-to-ticket-automation-v2

Originally a fork of Combodo's Mail to Ticket Automation, enriched with some new features. Also contains some bug fixes.
https://jeffreybostoen.be
6 stars 3 forks source link

Feature: only keep new parts #15

Open jbostoen opened 2 years ago

jbostoen commented 2 years ago

Note: this feature can be sponsored!

Use case: agent responds from iTop to the client. E-mail is sent to the client; client hits "reply". Automatically the e-mail message with the agent's reply is included.

It may be interesting in an e-mail based ticket system to only keep the "new" part of the email and strip the other parts.

Scenarios to consider, which complicate the implementation:

Just splitting by a basic pattern or occurrence of certain HTML is a bad idea:

Ideal situation would be if log entries could be queried separately. However, iTop still doesn't support this.

Other difficulties: the current implementation of Mail to Ticket (Combodo and this fork) build a description and also process inline images etc, adding new links with random IDs.

So the basic approach, considering the current limitations:

Known limitations:

Investigation needed:

jbostoen commented 6 months ago

Another interesting note in the design: MS Outlook for example adds this HTML

<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Some Name &lt;some@address.ext&gt;<br>
<b>Sent:</b> Friday, December 15, 2023 9:59:10 AM<br>
<b>To:</b> Jeffrey Bostoen &lt;some@address.ext&gt;<br>
<b>Subject:</b> RE: something</font>
<div>&nbsp;</div>
</div>
...

Now, note that iTop does HTML sanitizing; and that this has changed a bit over time already (for example: ordered/unordered lists).

https://www.itophub.io/wiki/page?id=latest:admin:rich_text_limitations

So when developing something, it may be worth considering whether this is compared against the original HTML (so also -temporarily- store the original HTML rather than the sanitized one).

jbostoen commented 6 months ago

French version:

De : Abc Def support@x.be Envoyé : vendredi 29 décembre 2023 14:42 À : Abc Def x@x.ma Cc : y@x.ma Objet : [ R-000322 ] iTop: xxx

In iTop, after sanitizing, all the above content was in a SPAN element.

Also a point to consider: inline images (links).