Automatically flag emails as spam via flows

Par 

3 minutes de lecture
LWC

Introduction

Often when you implement « Email-To-Case » in your organisation, you will quickly be confronted with spam. Receiving a lot of spam can have an impact on your users’ time. Let’s see how we can automatically qualify incoming emails to flag them as spam and save your users time.

Requirements

To carry out the implementation you will need knowledge of the following topics:

  • Flow
  • Custom Metadata Type
  • Email-to-Case
  • Formula

Implementation

Create a Checkbox field IsSpam on the Case object

Checkbox Is spam field

Checkbox Is spam field

Create a Custom Metadata Type « Keyword »

This custom metadata type will contain all the keywords that we will use to search for them in the emails.

Custom metadata type Keywords

Custom metadata type Keywords

Here are some examples of keywords you can fill in

IMPORTANT: You must enter the keywords in capital letters.

List of keywords

List of keywords

To build your keyword base, you can look on the internet, many sites offer a list that you can use.

The Most Common Email Spam Words

Avoid these 250 trigger words to stop your emails going to spam

Building the flow

Presentation of the flow

Global presentation of the flow

1.Entry conditions

Nothing special about the entry conditions for the flow

Entry conditions of the flow

Entry conditions of the flow

Object : Case

When : A record is Created

Conditions : Origin Equals Email

Optimize the flow for : Fast Field Updates (Before)

 

2.Retrieving Keywords

We first need to get the keywords from the custom metadata type Keywords__mdt and loop over this object

Get records from keywords

Get records from keywords

We get the « Label » field which we will use to search for it in the email we receive.

Detail of loop

Detail of loop

 

3.Conditions for flagging the case as spam

In order to test if each of the keywords are found in the email we have created two formulas.

Formule : UpperDescription

UPPER({!$Record.Description})

This formula will be used to uppercase the content of the email in order to test the keywords and the content in capital letters only

Example :

  • « Test » == « TEST » => FALSE
  • UPPER(« Test ») == « TEST » => TRUE
UpperDescription Formula

UpperDescription Formula

Formule : IsSpam

CONTAINS({!UpperDescription} , {!Loop_keywords.Label})

We will search if each item of Keywords__mdt (Loop_keywords) is present in UpperDescription

IsSpam Formula

IsSpam Formula

Decision IsSpam ?

IsSpam Decision

IsSpam Decision

Flag the case as spam

Flag as SPAM

Flag as SPAM

 

When the case is flagged « SPAM » we stop directly, we do not need to continue with the other keywords.

Getting out from the loop

Getting out from the loop

Now you can test it and use it to flag incoming emails as spam :)

You can also use the notion of weight for your keywords for spam and if a case that is created with an email exceeds a certain weight, you can flag it as spam.

You can see my other articles here or read the latest blog posts here

A lire également sur le blog

Copado

Introduction à Copado

Vous aimeriez avoir une idée de ce qu’est Copado, savoir ce qu’apporte l’outil et le tester éventuellement ? Peut-être souhaiteriez-vous aussi connaître les étapes pour se former dessus ? …
avril 2024
Conseils
Interview-Romain-Quijal-Texeï

Portrait de Texiens : Romain Quijal, Développeur chez Texeï

👋 Découvrez le portrait de Romain Quijal, Développeur chez Texeï ! 🚀 Arrivé il y a un peu plus d’un an chez Texeï, Romain une étoile montante dans l’univers …
avril 2024
Interviews

Comment utiliser le pré-header ?

Comment utiliser le pré-header ? Dans le paysage en constante évolution du marketing numérique, la création d’emails captivants est devenue un véritable art. Chaque élément joue un rôle crucial …
mars 2024
Conseils
Avantages de Salesforce pour les PME

Pourquoi faire de la conduite du changement ? 

D’abord, qu’est-ce que la conduite du changement ? La conduite du changement (aussi appelée change management ou change) sert à accompagner les différentes parties prenantes lors d’une transformation dans …
mars 2024
Conseils
Interview-zoe-texei-1

Portrait de Texiens : Zoé Cadiou, Responsable Marketing Opérationnel

👋 Découvrez le portrait de Zoé Cadiou, Responsable Marketing Opérationnel chez Texeï ! 🚀 Arrivée chez Texeï en tant que Responsable de Communication, Zoé endosse désormais la casquette de Responsable …
février 2024
Interviews
Virgile-Paré-portrait -de-texien

Portrait de Texiens : Virgile Paré, Senior Business Analyst

👋 A l’honneur dans notre portrait de texiens, Virgile Paré, Senior Business Analyst, Spécialiste CRM-Analytics, et Manager chez Texeï ! 🚀 Arrivé il y a deux ans maintenant, Virgile …
février 2024
Interviews