Strip content from emails before creating a ticket

Under microsoft email I have a few disclaimers and warning that come in via email.
I would like to strip that from going into the ticket.

example:

You don’t often get email from reminder@cheapsslsecurity.com. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification
To view this email in your browser, click herehttps://hrdnl69e.r.us-east-1.awstrack.me/L0/https:%2F%2Fcheapsslsecurity.com%2Femail.aspx%3Fu=T1l64166%252fqeCWA5hew4xVQ%253d%253a5df-0712ed14-facc-458a-b660-4841b4a883cd-000000/NK

also want to remove these:
image

Hi @jamie ! Thanks for posting here.

The way to do this is to create a new global variable (I’ll call it global.body) with the full contents of the body of the email. Then, perform the following steps:

  • If global.body starts with External Email -- This message is being sent from a user outside the organization, overwrite global.body with the contents of global.body after the text you want to remove.
  • If global.body contains "You don’t often get email from …, overwrite global.bodywith the contents ofglobal.body` after the text you want to remove

You can do all of this in a rule at the beginning of your mailbox (the first rule in the list of rules), and then you can use {{global.body}} within any rule in that mailbox.

Here’s what the rule could look like:

The expression for step 2: