Matching an Email

My application looks for incoming emails and matches the 'Subject' string with a unique Token (string) that was previously created in Mendix. This is currently achieved using a Retrieve from database with the Xpath constraint [$IteratorEmailMessage/Subject = Token] which works fine. I have 2 questions: i) We currently use the email 'Subject' as the attribute to hold the Token  - is there any other (string) attribute of the email that could be used to pass the Token (I have tried using the CC but Outlook complains that the Token isnt a valid email address) so that we could preserve any original Subject text? ii) If no good answer to question above I could append the Token to the original 'Subject' in the email (so that the original subject text is preserved) and use the 'contains' function to look for the Token string within the 'Subject' string. Please could you tell me how the Xpath constraint would be formatted in this case. Many thanks.
1 answers


In my apps, I have accomplished this by appending the Token to the end of the email body delimited by a string (in my case ### before and ##### after the token).  Then when I receive an email, I look for this token and delimeters in the email body.  This can be accomplished through a contains xpath statement (for example   [contains(Name,'######')]  ) or a series of find string functions used in a microflow (find the starting ###, then find the ending ##### and locate your token between those two using substring functions).

Hope that helps,