Use Case: Use Flow To Auto Close The Spam Case

Spam is like a never-ending fight, especially for marketing and support teams. Of course there are many 3rd party apps that help to detect the spam, but you can also build an easy and lightweight solution using Flow! Today let’s see how to store email addresses into a block list, and auto close the spam case with Flow.

* Big thanks to D. James for sending in the case!

Lulu Mobile use standard Email-To-Case feature as part of their customer support. Sometimes they will find many spam cases sent in by a specific email address, so they want to store these email addresses in a block list. Next time if there is a new case from any of these addresses, they want to automatically mark it as spam and close the case.

The original request is as such:

  1. Let user click a button to store a web email as a custom metadata type record (Block list)
  2. Whenever a case is created from a blocked email, the case should be automatically marked as spam and closed

For Flow #1, we will use a Screen Flow and make it an Action. However, We cannot create custom metadata type record in Flow yet. So instead of using a CMDT, we will use a Custom Object called Block Emails.

In Block Emails object, I have only one custom field called Email To Block (Email_To_Block__c).

For Flow #2, we will use a Record-Triggered Flow but fire it on Email Message, instead of Case. The reason is when we are using Email-To-Case, the connection between the Case and the Email Message is established after the triggers for Case finish running. If the flow runs on Case, it won’t be able to find the originated email address. You can see this discussion thread for more information.

Flow Chart (deactivate last login date)

Flow #1: Add Email To Block List

Flow #2: Auto Close Cases Sent By Blocked Emails

Steps (deactivate last login date)

Please wait while flipbook is loading. For more related info, FAQs and issues please refer to DearFlip WordPress Flipbook Plugin Help documentation.

Screen Flow and Record-Triggered FlowGet RecordsVariable/Collection
AssignmentCreate RecordsRecord Id
DecisionUpdate Records

Does the solution solve your problem? If not, write us what your problem is and we will build the flow for you!

Official Salesforce Help Article On Flow

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Wayne Cecil

I’m new to flows, so your site is really helpful to me. I was able to get Flow #2 to work, but Flow #1 still wont work for me. I’m still trying to figure out where I went wrong. However, just to get Flow #2 to work was really helpful. Thanks!