The following are static methods for EmailMessages.
-
getFormattedThreadingToken(recordId)
Returns an email threading token that’s formatted with the correct prefix and suffix. This token can be embedded in an outbound email body, email subject, or both the body and subject. When users reply to the email, threading tokens can be used to attach responses to a record, such as a Case record in Email-to-Case. -
getRecordIdFromEmail(subject, textBody, htmlBody)
Returns the record ID corresponding to the specified email threading token, or returns null if none is found.