First Last Prev Next    No search results available
Details
: Custom Templates: Regular expression to extract from subject
Bug#: 26214
: quickFilters
: General
Status: RESOLVED
Resolution: FIXED
: PC
: Linux
: unspecified
: P2
: enhancement
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: T4ng10r <tanglor@poczta.onet.pl>
Assigned To: Axel Grude <axel.grude@gmail.com>

Attachments
quickFilters 3.2 Prerelease 9 (287.86 KB, application/x-xpinstall)
2016-05-04 12:03, Axel Grude
no flags Details
quickFilters 3.2 Prerelease 9 (287.86 KB, application/x-xpinstall)
2016-05-04 12:05, Axel Grude
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2016-04-28 03:11
Expected result:
1. User move mail to folder triggering filter creation.
2. User selects custom template
3. Custom template run regex on subject to extract word/sentence which will be
set in Match Rule field

Possible solution:
1. User create custom template.
2. User select %regexpSubject("REGULAR_EXPRESION")%


Example:
Mail subject
"Re: Case JR123123 [TOP][CRITCAL][INTERNAL] : Hardware failure during ...."
Subject Match rule : JR123123
------- Comment #1 From Axel Grude 2016-04-28 03:37:22 -------
Accepted. It is somewhat esoteric but may come in handy. I might even be able
to add it in my other addon SmartTemplate4 (which the header variables are
actually copied from)
------- Comment #2 From Axel Grude 2016-05-04 12:03:08 -------
Created an attachment (id=8180) [details]
quickFilters 3.2 Prerelease 9

Implemented the new custom header field: %subjectRegex()%

It takes one variable, a regular expression which doesn't need to be wrapped in
double quote characters. To test, open quickFilters settings and go to the
Advanced tab. Click [New...] Custom Template, and give the new template a name.

In the quickFilters Custom Template editor, on the top right select Custom
Variables > Subject Regular Expression. This will add a condition:

Subject contains %subjectRegex()%

Insert a regular expression, e.g.

%subjectRegex(\+[0-9]{4}\+)%
in order to catch four digit numbers delimited by +  (e.g. +1234+)

Save the Custom Template.

No create a new filter based on an email that has +1234+ in the subject. The
filter assistant will call Regexp.exec() and pull out the _first_ match only
and then add it to the conditions as 

Subject contains +1234+

(Note that the regular expression is only expanded / converted during
_creation_ of the filter. When the Filter is applied the _value_ is used - so
no regular expression matching occurs during filter executing the filter.
------- Comment #3 From Axel Grude 2016-05-04 12:05:09 -------
Created an attachment (id=8181) [details]
quickFilters 3.2 Prerelease 9

Implemented the new custom header field: %subjectRegex()%

It takes one variable, a regular expression which doesn't need to be wrapped in
double quote characters. To test, open quickFilters settings and go to the
Advanced tab. Click [New...] Custom Template, and give the new template a name.

In the quickFilters Custom Template editor, on the top right select Custom
Variables > Subject Regular Expression. This will add a condition:

Subject contains %subjectRegex()%

Insert a regular expression, e.g.

%subjectRegex(\+[0-9]{4}\+)%
in order to catch four digit numbers delimited by +  (e.g. +1234+)

Save the Custom Template.

No create a new filter based on an email that has +1234+ in the subject. The
filter assistant will call Regexp.exec() and pull out the _first_ match only
and then add it to the conditions as:

Subject contains +1234+

Notes:

(1) the regular expression is only expanded / converted during _creation_ of
the filter. When the Filter is applied the _value_ is used - so no regular
expression matching occurs during filter executing the filter.

(2) when the custom template is created the name follows the pattern
"quickFilterCustomTemplate: XXX" do not delete the "quickFilterCustomTemplate"
portion as it is needed for the filter assistant to display the new template in
the filter assistant. It will be cut off automatically and only the "XXX" part
displayed.
------- Comment #4 From Axel Grude 2016-05-20 04:28:37 -------
Renamed the feature for clarity.
------- Comment #5 From Axel Grude 2017-03-24 07:21:21 -------
Resolve FIXED: Released officially in 3.2

First Last Prev Next    No search results available