Posts

Showing posts with the label Inbound Emails

Find Case ThreadId using Apex and Formulas

Ensure that an email sent to your customer support email is attached to an existing case using Thread ID. Formula - "ref:_" & LEFT($Organization.Id,5) & RIGHT($Organization.Id,5) & "._" & LEFT(Id,5) & SUBSTITUTE(Left(RIGHT(Id,10), 5), "0", "") & RIGHT(Id,5) & ":ref" Apex -  ref:_'+ UserInfo.getOrganizationId().left(5) + UserInfo.getOrganizationId().mid(11,4) + '._'+ caseId.left(5)+ caseId.mid(10,5) + ':ref ]'; The actual extraction of the thread ID is looking for anything in between "ref:" and ":ref" Example of a thread id: ref:_00D30oKPx._50030bwIii:ref Note: If multiple thread IDs are included in the header or the body of the email sent, the email will attach to the Case that is represented by the first thread ID in the string: Example  [ ref:_00D30oKPx._50030bwIii:ref ] [ ref:_00D30oKPx._50030bMuaN:ref ]  the email will attach to the case represented by ref:_00D30oKP...

Email Services in Salesforce

Image
Email Services in Salesforce allow you to automate the processing of inbound emails. You can define an email service that listens for incoming emails, processes them according to your logic, and then takes appropriate actions like creating records, updating records, or triggering workflows What Are Email Services? To use email services, from Setup, enter Email Services in the Quick Find box, then select Email Services. Here are some of the considerations An email service only processes messages it receives at one of its addresses. Salesforce limits the total number of messages that all email services combined, including On-Demand Email-to-Case, can process daily. Messages that exceed this limit are bounced, discarded, or queued for processing the next day, depending on how you configure the failure response settings for each email service. Salesforce calculates the limit by multiplying the number of user licenses by 1,000; maximum of 1,000,000. For example, if you have 10 licenses, you...