Sprache wechseln auf deutsch
Znuny Professional Services

The ((OTRS)) Community Edition Fork with long-term Support (LTS)

Postmaster Filter Capture Groups

Why sort mails manually when not necessary? Do you have a pre-defined subject, sender, or email header? Let the Postmaster Filter work for you. Presort incoming emails by filtering and capturing data directly from email forms or other templated emails.

Postmaster filters can be most valuable in filing emails and collecting pre-defined information. Many emails generated in forms or applications like Lotus Notes or Microsofto Outlook email have a predefined subject. Today we will address parsing an email subject and capturing data from it.

Example Subject:

Pre-order Wonder Milk / P1U324-100245A

Our ordering software generated this email subject and sent the mail to warehouse@wondermilk.exapmle.com. The warehouse team must record the product ordered, assign a customer to the ticket, and copy the invoice number to the proper dynamic field on the ticket. This all takes time, and the orders are mounting.

Let's automate this.

First we identify our sender:

From order-machine@wondermilk.exapmle.com

Then we identify the data from the Subject.

Pre-order Wonder Milk / P1U324-100245A

Product: Wonder Milk
Customer: P1U324
Order Number: 100245A

All we do now is filter for the parts we want to capture, and save them to the appropriate fields.

Create fields for Order Number and Product Name

This screenshot shows what a possible filter option.

Figure 1 - Example Postmaster filter

We match using a regular expression and placeholders for our matching groups:

(?<product>\w+ \w+) \/ (?<customer>.{6})-(?<ordernumber>.{7})

Let split this a little bit up.

(?<product>\w+ \w+) \/

This group matches the two words just before the forward-slash: Product Name

(?<customer>.{6})

This group matches the 6 character customer number.

(?<ordernumber>.{7})

This group matches the 7 character order number.

We replace thees in our dynamic fields and CustomerNo field using the square bracket expressions.

[**\placeholder**]

Any mail that comes in is evaluated, and as seen in our communication log it's updated when it matches.

Figure 2 - Excerpt from the communication log

Here is the ticket data without intervention from any user.

Figure 3 - Extracted fields shown

Be creative and automate your way to success.

Have fun with Znuny ❤️!