I’ve been focused on developing a workflow tailored to manage incoming customer enquiries. A key aspect of this process involves monitoring a sales mailbox for new customer emails. I use Abbyy Flexicapture to poll the mailbox and import the email and its attachments. The attachments will be processed entirely by FlexiCapture to extract their contents but the email needs handling differently. In order to efficiently handle these emails, I’ve implemented a system that categorises them into five primary categories:
- Initial Enquiry.
- Follow-Up.
- Order.
- Complaint.
- Delivery Chase.
Additionally, it’s imperative to thread these captured emails together, enabling users to track the conversation and facilitating our ability to provide updates. I’ve gained some valuable insights into email headers and structure.
The “Message ID,” a critical element found within email headers, plays a pivotal role in tracking and identifying emails. This unique string, generated by the mail server, incorporates the sender’s domain, timestamp, and a random string.
Equally significant is the “In-Reply-To” header, which serves to link emails to previous ones within a conversation. This header contains the message ID of the parent email to which the current one is replying, essentially forming a digital thread that connects related messages.
Utilising these headers in conjunction with Abbyy FlexiCapture, LLM, HtmlAgilityPack, and MimeKit, I can effectively:
-
- Categorise incoming emails.
- Thread replies together.
- Extract the user-readable content from the emails.
By integrating these methods with the techniques outlined in my previous post on converting unstructured natural language into structured JSON, I’ve established a robust foundation for the solution.
The screenshots above show the results in FlexiCapture after sending the email text to an LLM as part of the capture workflow.