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:
- Let user click a button to store a web email as a custom metadata type record (Block list)
- 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 #1: Add Email To Block List
Flow #2: Auto Close Cases Sent By Blocked Emails
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 Flow||Get Records||Variable/Collection|
|Assignment||Create Records||Record Id|
Does the solution solve your problem? If not, write us what your problem is and we will build the flow for you!