Jump to content

Email regex to do "respond above line"


billster

Recommended Posts

Hi all,

I would hope if you could help me figure out a regex to set up a =====respond to email above this line===== regex rule. I've set up an incoming rule that automatically updates the ticket in question, however, each time you email it then it would update the whole ticket with the whole email thread over and over again. How do I make it so it cuts off the old responses and only updates the ticket with the new responses?

I tried to create this regex, but for some reason it doesn't work in Hornbill.

^.*(?=\n=====respond to email above this line=====)

https://regex101.com/r/wYeCS3/1

Link to comment
Share on other sites

Hi @billster,

ASSUMING you are using this in the BP, there are a couple of things you need to know. The engine behind the scenes is ECMAScript and the RegEx you are likely going to want is:

([.\s\S]*)^=====respond to email above this line=====$

With the following flags:

gm
Link to comment
Share on other sites

On 8/5/2022 at 5:24 PM, SamS said:

Hi @billster,

ASSUMING you are using this in the BP, there are a couple of things you need to know. The engine behind the scenes is ECMAScript and the RegEx you are likely going to want is:

([.\s\S]*)^=====respond to email above this line=====$

With the following flags:

gm

Hi @SamS I was using this in the email routing rule but seems not to do anything, so I'm thinking it isn't entirely possible to filter out old responses in emails threads.

image.png.a88e4cacd7ea67119f9983c81f1784fe.png

 

Although, I think I have found a bug. If I create an email routing rule and change 'use operation' to OFF then save and reload the web page it is still showing as 'ON' and the rule isn't actually turned off.

 

Thanks

Link to comment
Share on other sites

38 minutes ago, billster said:

Hi @SamS I was using this in the email routing rule but seems not to do anything

What are you expecting it to do?

REGEX_MATCH will return true or false depending on whether it finds a match. It will not do anything else.

Routing Rules do not manipulate the email, they simply perform the required operation (move to folder, raise request etc.) if the expression matches and pass the email to the next rule if it doesn't.

Link to comment
Share on other sites

On 8/5/2022 at 4:09 PM, billster said:

How do I make it so it cuts off the old responses and only updates the ticket with the new responses?

@billster you cannot, the autoresponder does not have such functionality. As Steve advised, autoresponder will simply raise or update a request without any changes to the email content that will end up in the request.

  • Sad 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...