Scenario: The requirement is to send mail through apex but the tricky part is to identify the old email email chain (that once started from Salesforce then received by the receiver then the receiver again replies) and send a mail on that chain.
For eg, with the help of Salesforce a receiver receives an email to respond with either yes or no, but somehow mistakenly the receiver replies with a wrong keyword.
Now, we need to fetch this mail chain and tell the user that please reply with a valid response by sending a mail.
Note : I was able to send mail but the mail is always getting sent as a fresh mail (not on the existing mail chain).
- I guess using
setReferences()
method fromMessaging.SingleEmailMessage
Class we can do so but I'm unable to get what exact string should I pass into that method.
Hope I was able to make it clear!!
Any help would be much appreciated!!