Assistance with Parsing Emails and Automatically Creating Leads in Odoo CRM

Hello Support Team,

I need assistance with automating the processing of my incoming emails to create leads in Odoo CRM. I’ve been trying to get this to work for the past two days without success.

The text of my emails looks like this:

[https://example.com/wp-content/uploads/2024/01/logo-mail3.png] BOOKING DETAILS
Booking REF ID #: 217

Date: 2024-07-05

Time: -

Member Name: -

PROVIDER DETAILS
Provider Name: Dr. med. Hans Somer [https://example/doctor/dr-med-hansommerfeld/]

Provider Email:
Phone:

CUSTOMER DETAILS
Customer Name: Schmitt Mustermann

Customer Email: abcd@yahoo.de

Phone: 06925424524

WhatsApp: 01765162214

Address: Espenstr. 28

Zip code: 692521

City: Frankfurt am Main

State: Hessen

Postal Code:

Country: Germany

Services:

Service NameDateStart TimeEnd TimeFull DayStatusMember NameCoupon > CodeDiscountDiagnosis of Bladder cancer-0001-11-30–noIncomplete -NANAService Location: Frankfurt am Main

Description:

PAYMENT DETAILS
Pay Via: Free

Amount: €2890.00

Admin Fee: €0.00

SERVICE DETAILS
DISEASE(S) SYMPTOMS TO BE TREATED
—WHAT DO YOU EXPECT FROM THE SELECTED SERVICE? E.G. SPECIFIC > TREATMENT DESIRE (E.G. SURGERY, RADIOTHERAPY, DIAGNOSTICS)
—WHICH DIAGNOSTIC TESTS WERE PERFORMED DURING THE LAST 3-6 MONTHS?
IMAGING TECHNIQUES
—HISTOLOGY
—WHICH TREATMENTS HAVE BEEN PERFORMED FOR THE DISEASE(S)/SYMPTOM(S) MENTIONED ABOVE?
—Kind of TreatmentDescription
(Operation, medication, irradiated body part, etc.)Date performed
(MM/DD/YYYY)Operation / Intervention
(e.g. heart catheter)------Drug Therapy
(e.g. Chemotherapy other medication)------Irradiation
please add previous radiation treatment protocols------Other------DO(ES) YOU/THE > PATIENT HAVE ANY OPEN WOUNDS AT PRESENT?*
NoPLEASE INDICATE YOUR/THE PATIENT’S PRESENT MOBILITY STATUS?*
not limited

I want to extract the following information from the text content:

  • Customer Name: Schmitt Mustermann
  • Customer Email: abcd@yahoo.de
  • Phone: 06925424524
  • WhatsApp: 01765162214
  • Address: Espenstr. 28
  • Zip code: 692521
  • City: Frankfurt am Main
  • State: Hessen
  • Country: Germany

So far, I have followed these steps:

  • Receive emails.
  • Parse information using the following patterns:
Customer Name: ([a-zA-Z ]+) Customer Email: (\S+@\S+\.\S+) Phone: (\d+) WhatsApp: (\d+) Address: ([a-zA-Z0-9\.\s]+) Zip code: (\d+) City: ([a-zA-Z ]+) State: ([a-zA-Z]+) Country: ([a-zA-Z ]+)

However, I am not getting any output from the text parser. I checked the history and found no results.

Could someone please help me resolve this issue?

Thank you in advance!




Blueprint:
blueprint.json (21.3 KB)

Hello @Ruth and welcome to the Make Community!

Instead of Text Parser Match Pattern, you might try using Text Parser Match Elements which can be configured to look for key:value pairs

This might work nicely in your case.

Hello @Donald_Mitchell,

Thank you for your quick response. I think it works better with Parser Match Elements:

However, when I go to Odoo CRM, I cannot see the parsed values:

Should I use any other app between them?

You could follow the Text parser with an Array Aggregator.
This will give you an array, on which you can use map() and get() or first() to get the values out of it.
Customer Phone will be a problem because “Phone” occurs twice and only the first (for provider) is matched.

Here’s a blueprint you can check out for some examples.

Service Details, if you need them, will need to be picked up a different way.
For that (assuming “SERVICE DETAILS” only appears once in the entire text) you could use a split() function in conjunction with a last().

MatchElements.json (14.4 KB)

2 Likes