I would like to share a case where I think I have found a solution but maybe not the most powerful
I have a generic flow plugged on several email ‘box’
the first step of this flow Is to determinate the Customer destination e-mail, that enable to call a datatable for key destination email and retrieve data for routing decision
On a first time, we have parsed the ‘To’ of the incoming email however:
if several email adress are present
if an allias for the destination was used
if the email adress was un the cc or the Cci
This method failed
So I was looking for another solution, I was looking for an api that could give me the entry mailbox , for each email coming in the flow
But I found no direct api to get this information
However I found the following
When you are using the following API:
GET /api/v2/conversations/emails/[Conversation_ID]/messages/draft
a kind of pre packaged answer is returned by API
if you launch this API on flow before pushing the interaction in queue and no different reply email adress is confiture, this API returns in the "From" of the Json , the mailbox where the mail comes from
The GET /api/v2/conversations/emails/[Conversation_ID]/messages/draft endpoint is not meant for this.
It is leveraged by the Genesys Desktop, when a user is working on a reply to an email (is editing the reply - before clicking Send). It is just a kind of temp storage for the edited content.
I don't think there is a property/attribute available which stores a reference to the destination e-mail in all type of email flows/cases (specifically BCC). At least, I couldn't find one.
I have tried to retrieve the conversation context with GET /api/v2/conversations/{conversationId} and the conversation details with GET /api/v2/analytics/conversations/{conversationId}/details but I couldn't find something that work in all situations.
Specifically with the BCC case (when the Contact Center email address is in BCC), the email address does not seem to be propagated to the conversation context/details.
I could not try with an email alias (in To or CC) as I don't have one available/set. I assume the conversation context/details reflect the alias value (just like the Architect built-in variables Email.Message.to and Email.Message.cc).
Regarding your comment on failed parsing, it will fail on bcc (Email.Message.bcc - value is not propagated).
I assume you should be able to parse the Email.Message.to and Email.Message.cc (these are arrays of email addresses).
An expression like this should tell you if an email address is included (>=0) or not: FindFirst(Email.Message.to, MakeEmailAddress("myservice@company.com")) >= 0
and FindFirst(Email.Message.cc, MakeEmailAddress("myservice@company.com")) >= 0