Autoclose Spam mails Autoclose Spam mails

Autoclose Spam mails

Bernard Moriau Bernard Moriau

Currently, multiple clients from Zendesk get inundated with Spam Mail
with titles like  nQnHq用你IP帮我打綵漂每天3OO伽qun927553967

Screenshot 2024-05-03 at 13.32.42.png
As it always concerns other users, marking the user as a spammer or blocking the user will not help you. Therefore, you might want to autoclose these tickets.

Option 1 > autoclose the spam tickets

Option 2 > autodelete the spam tickets

Option 1 > autoclose the spam tickets

you can create a trigger that changes the status of the tickets directly to closed

condition in the trigger should be as follows

  • If the ticket is created
  • and it contains in the subject any of the following stings (list starting from qun0 ->to qun9)
  • Action is > status category = closed + add tag like "spam_qun" - this way you can easily find them back and delete them afterwards
    Screenshot 2024-05-06 at 09.10.51.png

Option 2 > autodelete the spam tickets

In this case you will need to create a webhook first

Create Webhook

First, we create the webhook in Admin Center > Apps and integrations > Webhooks. Use the details below to configure it.

  1. Create an API token and save it somewhere so you can copy/paste it at later stage
  2. in the admin panel > create a webhook
  3. Select Trigger or automation

 

Screenshot 2023-08-18 at 12.56.23.png

Screenshot 2024-05-03 at 13.53.43.png

Name: Delete spam

Endpoint URL: https://client.zendesk.com/api/v2/tickets/{{ticket.id}} (replace here client with the domain name of your zendesk instance)

Username: emailaddress/token (needs to be the email address of an admin and don't forget the /token at the end)

Request Method: DELETE

Request Format: Basic Authentification

Password: API token you copy paste (see step 1)

 

Trigger/automation actions

Now that we have our webhook, we can invoke it from trigger or automation actions:

create a trigger that says 

  • If the ticket is created
  • and the subject contains string: qun0, qun1, qun2,... 
  • Screenshot 2024-05-16 at 14.32.29.png
  • Action is > webhook > Delete Spam

do note that if a new badge of spam comes in with a different subject, you need to add it as a new criterion for the trigger to work

 

Screenshot 2024-05-03 at 14.00.10.png

 

 

Articles in this section