Domanda

I'm going to develop a ticketing system with c# that should send an email containing the ticket content to the receiver upon ticket submission and the receiver should be able to reply to that email which results in sender receiving the email of the reply. What puzzles me is that how am I going to keep track of that specific ticket which being replied by the receiver. I'm not looking for any code, just concepts or best practices.

È stato utile?

Soluzione

Theoretically, you might use the Message-ID in conjunction with In-Reply-To, as described in the RFC 5322:

The "Message-ID:" field provides a unique message identifier that refers to a particular version of a particular message. The uniqueness of the message identifier is guaranteed by the host that generates it (see below). This message identifier is intended to be machine readable and not necessarily meaningful to humans. A message identifier pertains to exactly one version of a particular message; subsequent revisions to the message each receive new message identifiers.

The "In-Reply-To:" and "References:" fields are used when creating a reply to a message. They hold the message identifier of the original message and the message identifiers of other messages (for example, in the case of a reply to a message that was itself a reply). The "In-Reply-To:" field may be used to identify the message (or messages) to which the new message is a reply, while the "References:" field may be used to identify a "thread" of conversation.

When creating a reply to a message, the "In-Reply-To:" and "References:" fields of the resultant message are constructed as follows:

The "In-Reply-To:" field will contain the contents of the "Message-ID:" field of the message to which this one is a reply (the "parent message"). If there is more than one parent message, then the "In-Reply-To:" field will contain the contents of all of the parents' "Message-ID:" fields. If there is no "Message-ID:" field in any of the parent messages, then the new message will have no "In-Reply-To:" field.

Of course, you should keep tracking of mappings between the Message-ID field and you internal ticket number in a separate database table.

Example

  1. A new email E1 is sent from yourCompany.com.

  2. A reply R1 is received from yahoo.com. The message header information:

     References:
         <11111@yourCompany.com>
     Message-ID:
         <22222@webServer.yahoo.com>
     In-Reply-To:
         <11111@yourCompany.com>
    
  3. A reply R2 to R1 is sent from yourCompany.com.

  4. A reply R3 to R2 is received from yahoo.com. The message header information:

     References: 
         <11111@yourCompany.com>
         <22222@webServer.yahoo.com>
         <33333@yourCompany.com>
     Message-ID: 
         <44444@webServer.yahoo.com>
     In-Reply-To: 
         <33333@yourCompany.com>
    

Altri suggerimenti

I think the only way to do this (and I never saw a ticketing-system who does that differently) is adding the ID into the subject-line.

In our case, we have subject-headers like "bla bla bla <<< CALLID: 12312 >>>". With regex, that's quite easy to catch

Keep the ticket in the Subject in a specific format that the application can understand.

e.g. Subject can be Close TICKET T1 or Reject Resolution TICKET T1 .

You can ask the customer to specify the reason in the mail body.

the trick is to give pre-formatted Subject which you understand.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top