How to track an email thread programmatically

狂风中的少年 提交于 2021-01-29 05:13:43

问题


I'm working on a system that handles customer inquiries and sends emails to customers related to their inquiries. When a customer replies, I need to know which inquiry (and email thread) the email belongs to. One customer may have multiple inquiries, so I cannot tell this just based on her email address.

I tried to google a bit and it seems that adding some kind of inquiry ID to the subject and the body may be a solution, but this is not 100% safe (customer can delete both).

I also see that for example AirBnb sends customer emails from a special, unique email address and my reply also goes back to that address, but I don't know if it is an inquiry specific email address or what.

As this seems to be a common problem in similar systems, I would appreciate any pointers to best practices.


回答1:


I'm not sure if this completely fits your needs, but there is a standard algorithm that mail clients use to group messages by "conversation" that is described by Jamie Zawinski here and, later, by the IETF Standards Organization, here.

There are a number of implementations of this algorithm for various languages including my own implementation in c# (source code). Typically you can search for it by the name "jwz threading algorithm".



来源:https://stackoverflow.com/questions/53578896/how-to-track-an-email-thread-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!