Text Parse from Email Subject & Body

I’m trying to parse order confirmation emails to get the important bits of data. That data will be used to create a card on a Basecamp4 card table.

Email module is set up.
Basecamp API call module is set up.
I got a successful test without any parsing (because it confuses the hell out of me).

here is what I want to pull out:

  1. the body of the email always contains:

“______________ will start working on your order soon.͏”
where the _____________ contains a vendor name such as “Acme Trading” or something like that.
I just want that vendor name. I cannot figure out how to parse that out of the example sentence.
So from “Acme Trading will start working on your order soon.͏‌” I just want “Acme Trading”

  1. The subject line always follows this format:
    “Your order has been received (#J746UAZTBG)”
    I just want to parse out the order number between the # and the ).

  2. the body of the email also contains an estimated ship date in the following format:
    “Est. Jul 31”
    I’d like that to become the due date for the Basecamp card, but have no idea how to parse that into a usable date format!

So this is my ideal end result:
Screenshot 2024-02-27 at 6.30.42 PM

Thank you so much for any help!

Question 1:

Welcome to the Make community!

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

(?<vendorname>\w+(?:\s\w+)?) will start working on your order soon\.͏

Proof

https://regex101.com/r/DA0syT

Important Info

  • :warning: Global match must be set to NO!
2 Likes

Question 2:

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

Your order has been received \(#(?<ordernumber>[^)]+)\)

Proof

https://regex101.com/r/r1zAXE

Important Info

  • :warning: Global match must be set to NO!
2 Likes

Question 3:

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

Est\. (?<date>\w+ \d{1,2})

Proof

https://regex101.com/r/Dka9ez

Important Info

  • :warning: Global match must be set to NO!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

2 Likes

Question 4:

According to the Tokens you can use to parse a date variable, you can use MMM D.

e.g.: {{parseDate(date; "MMM D")}}

(date variable is from previous text parser module)

For more information, see

Links

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

2 Likes