Bart | 2024-01-17 14:56:08 UTC | #1
Hey everyone,
We've implemented the e-mail flow in our own UI utilizing the JavaScript SDK, but I'll be referencing to the REST endpoints in this post for clarity.
When a conversation with an email is routed to an agent, we initiate a GET /api/v2/conversations/emails/{conversationId}/messages call to retrieve all the messages (EmailMessagePreview[]) associated with the email thread. Subsequently, we iterate through these messages in our UI components and enriching the content with a GET .../messages/{messageId} call (EmailMessage).
On some of our queues, an auto-reply is active, to let the customer know we've received their mail and will answer it within a few business days. This auto-reply is added as the latest message to the thread. This is logical so far.
However, the challenge arises when we need to differentiate auto-replies from customer and agent messages in order to filter or appropriately mark them in the UI. For example, determining the latest "real" mail in the thread, can't be done by simply taking the latest message.
One solution we've considered involves an additional call: GET /api/v2/conversations/emails/{conversationId}. By cross-referencing the IDs from the GET .../emails/{conversationId}/messages call with the messageId in this list, we can then check the autoGenerated flag to identify auto-replies.
While functional, this additional call feels somewhat redundant. Is there's a more streamlined approach that we might be overlooking? If not, I'm curious if it's feasible to enhance the EmailMessagePreview and EmailMessage objects by incorporating the autoGenerated flag directly?
Bart | 2024-01-29 14:03:06 UTC | #2
Anyone any ideas for recognizing auto-replies in EmailMessage objects? Is making the additional call the best way?
Bart | 2024-02-12 11:55:15 UTC | #3
I'm uncertain about the etiquette for bringing attention to my previous inquiries, but I intend for this to be my final attempt.
Is there a more effective approach to identify auto-reply messages within the array of EmailMessage without resorting to an additional API call?
system | 2024-03-13 11:55:26 UTC | #4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 24156