Skip to main content
Group

Salesforce Email-to-Case

Welcome to Salesforce Email-to-Case group! This is your one-stop shop for all things Email-to-Case. You're welcome to share your feedback and post your questions.

Today we utilize the RefId in the subject line of emails to route emails composed externally (in Outlook manually or via automations) where we want the email to be attached to an existing Case in our Salesforce instance.  We compose the email, put the RefId on the Subject, and CC our email-to-Case email address.

 

Is there going to be any way of replicating this once we activate Lighting Email Threading?  Can we generate a token to put into the subject (or body) that will route to the Case, even if no prior outbound email exists on that Case currently in our Salesforce instance?

 

Real-world example of why we do this: Customer submits a Case asking for a system usage report. We create that report and email it using our external system, but we want the report to be attached to the Case in Salesforce where the customer has made the request.  This provides us the ability to track that the report was sent to the customer and the Case can be closed.  If there is follow-up on the Case later, or the customer responds to the report email, the agent that owns the Case is notified.  

 

Not having this ability would be a major issue for us and the main reason we have not adopted Threading or message header Ids yet.

1 answer
  1. Mar 5, 2024, 5:27 PM

    @Paul Narsavage I think you should be able to replicate the existing functionality with the new Lightning threading tokens. This Apex method will generate a token for a case: https://developer.salesforce.com/docs/atlas.en-us.248.0.apexref.meta/apexref/apex_System_EmailMessages_getFormattedThreadingToken.htm

     

    If you want a simple way to view the token for a case, then you can give this custom component I built a while back a try: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5a000001XzZn

0/9000

Could we consider adding shortcuts to Code snippets?

During our workflow with paste Code lines for our customers very often - and in our previous helpdesk system we were able to mark a pasted text, click a button, and it would've been converted to a Code Block.

Here, to add a code block, I have to press a menu button (insert), select code sample, select the code sample type (though I guess it can stay as the default html/xml), type in the lines, and press save.

And even after that - it seems like the editor doesn't allow me to edit an already-pasted code block - it treats it as one character or something, attempting to delete something in it, deletes the entire code block.

 

Could we have a shortcut available in the toolbar to either:

1. Quickly open the 'insert new code' menu, or better yet in my head:

2. Being able to mark text and convert it into a code block

 

(Keyboard shortcuts to perform such actions are also very welcome, if possible).

2 answers
  1. Oct 24, 2025, 4:31 PM

    At SUSE we would be very interested in this as well. It's been a while...

0/9000

Not sure if this is the right group to post this in but figured the folks monitoring these threads have the most insight into email threading functionality. Summer '24 brings us, if I understand it correctly, a feature that I believe could have a major impact on tracking emails sent to and from objects other than Cases, specifically Use Threading Tokens in Emails. 

 

I am attempting to set a flow up that sends an email notification about something from a custom object that is related to a Case. Correct me if I am wrong, but I was hoping this new functionality would allow a record of that email to be shown either on the object record that triggered it, or the related Case. Per this article, I have the following configured in Send Email:

 

  • Email Template Id (that I got with a Get Records)
  • Log Email on Send set to True
  • Recipient ID is Contact on triggering record
  • Related Record ID--the Case ID that is related to this custom object
  • Sender Email Address
  • Sender Type

But in reading further per below this isn't exactly plug-and-play; it needs an Apex Email Service created for it to work? 

 

"If the related record is a case, Email-to-Case processes email replies automatically. Salesforce now also supports threading for other types of objects. To process incoming emails containing tokens that aren’t cases, create an Apex Email Service and use the EmailMessages.getRecordIdFromEmail function to find the record that matches the token. For example, if you’re implementing approval processing and you’ve provided a Related Record ID of a PurchaseRequest custom object record, use the Apex Email Service to retrieve the recordId and pass it to an autolaunched flow."

 

So if I figured out (or had someone help me) create the Apex Email Service, do I call that from the flow somehow instead of the settings I have in place? Does anyone have an example of how this should be configured for a custom object? Am I even close in thinking about how this should work?

 

Or what exactly is the expected outcome for this functionality?

 

P.S. I can see in the Activity Capture on the Contact that an email was sent, but don't want to send my internal users to the Contact record if they can simply see the email that was associated with the triggering  object. 

3 comments
  1. Aug 6, 2025, 3:20 AM

    I finally figured out this feature. It might be really late reply though. 

    1. Make sure your custom object its Track Activities feature is enabled 

    2. Use Send email Action by flow (any type of flow), which adds Thread Token 

    3. Create Apex Email Service class and configure Apex Email Service 

    3.1. Inside Apex class, it needs to get thread token by `getRecordIdFromEmail` method 

    3.2. Refer to the sample code;

    https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_EmailMessages_getRecordIdFromEmail.htm

     

    you need to replace the following because `parentId` is for only Case RecordId.

    // ParentId = caseId

    RelatedToId = recordId // RecordId is the Id returns by getRecordIdFromEmail

    4. Test sending email from Custom Object by flow.  

    5. Replies are linked to your custom object Id.

0/9000

Issue with "Transition to the Lightning Editor for Email Composers in Email-to-Case" release update is enabled.  A case has an email where there is an embedded logo like in the signature.  When the user copies the email content(ctrl A and C)  to paste in a new email window in Salesforce it only copies the logo but no other content. If you turn this release update off then you can copy and paste the email content in a new email window with it pasting all the content not just the logo. Is there any fix for this with turning on the release update?

2 answers
  1. Jul 30, 2025, 11:47 AM

    I opened a case with support.  They researched with product management and said it is a known limitation.  They will have it fixed before this update is enforced, currently there is no date for enforcement. 

0/9000

We recently got a user request to mark emails being sent from cases as 'High Priority', a feature already available when sending from Outlook.

 

Similarly, emails received in Salesforce that create cases, could have been sent from Outlook marked as 'High Priority', and in such a scenario, it would be interesting to see if we could trigger actions in Salesforce based on this.

 

It seems this is not possible at the moment, but there are open idea(s) on it, that have remained dormant for way too many years, without any response from Salesforce product managers. Is this something anyone could look into? 😊

 

High priority for email | IdeaExchange (salesforce.com)

Flagging email priority | IdeaExchange (salesforce.com)

2 answers
0/9000

Hello! 

I would like to remove the email composer pop-up and keep just the static one from feed. Would it be possible? How?

3 answers
  1. Khyati Mehta (InfinySkills) Forum Ambassador
    Jul 4, 2025, 8:21 AM

    Seems like that option is disabled. i remembered there was an option such back then. How about editing the page layout or action bar—remove the quick action that opens the email in a pop-up and make sure the Email tab is available in the activity section instead 

0/9000

We are testing the new Lightning Email-to-Case editor. When we use the full-screen mode, there is no Send button, no template and no attachment button.

 

All other buttons are there, but the most important ones are not ... 

 

Does anyone know if this is going solved?

7 answers
  1. Jun 24, 2025, 8:14 AM

    Hi, are there any plans to add Send button to the full screen mode? I think many people is expecting it.

0/9000

I switched to the new Lightning Email Compose in my Sandbox, but I noticed that only the Email Compose in the Case Feed has been updated to the new UI. The docked email editor remains unchanged and still uses the old UI.

However, when I tested it in another org (Developer Trial), both the docked email editor and Case Feed email editor were updated to the new UI.

Is there a difference between Sandbox and Production environments when applying new features?

Thank you for your help!

0/9000

Hi, I was wondering if it would be possible to set up that when a user is inserting a quick-text, after he selects a folder that the search option would only give him results from the folder he is in instead of from all the quicktexts he has access to.

 

So if i have the same quicktext set up multiple times for multiple languages and they are in their appropriate folders based on country for example. 

 

The user has access to 4 of them and after he selects the country folder and tries to search lets say based on a code he should get results from that folder instead of all 4 of them that he has access too.   

 

Any tips or suggestions are welcome.

3 answers
  1. Mar 6, 2024, 6:44 PM

    @Luka Arvaj thanks for the feedback. I just spoke to the team that owns Quick Text, and they've taken this suggestion and will try to implement search scoped to a folder in a future release.

0/9000

I have email-to-case setup in my org, with the emails forwarding to the Email Services Address that Salesforce generates. Our security team noticed that you can send an email directly to the Email Services Address to create the Case and Attachments. Basically this bypasses our mailbox and some of the security we have in place. Is there a way to block emails from people sending directly to the Email Services Address? We basically want the Email Services Address to accept emails forwarded from a specific email. 

 

I did notice the 

Accept Email From setting but my understanding is that applies to the sender of the email, not the forwarding email.

2 answers
  1. Mar 2, 2025, 4:16 PM

    Obviously, the best option is not to expose that email service address. But if its already out there... you can leverage the email headers to determine if the email was sent directly or via a forwarding rule. If the email was not via a forwarding rule you can either block the creation of the case. 

0/9000