Parsing Showingtime Emails

Parsing Showingtime Emails

Background

I am a real estate agent who has houses listed for sale. We have a system called ShowingTime that manages requests for showings on the listings. ShowingTime is third party app that does not have API. 

Note: I am not a programmer, I am a real estate agent. There are problems in the code for sure and probably better ways to do things. I am always open to suggestions or improvements you can please leave them in the comments.

Emails
The emails come formatted in HTML and CSS


The raw HTML looks as follows:

What I Need extracted:
I have a custom module in my CRM to track showings and inquiries on my listings which is called Inquiries.
It looks like this 


Therefore information I need extracted out of the email is as follows:
Buyer Agent Name
Showing Date
Buyer Agent Email
Buyer Agent Phone

Method of Extraction
I have employed a Flow to get mail (using Zoho Mail). The input from the mail is only the mail id. 


Then, using this function extract the data needed 

And build a map for inquiry and create new inquiry
Important note: 
Add this bit of code to trigger workflows, which is the whole point of automating the inquiry input


Conclusion:
I have plans to extend this function to include showings on buyers we represent as well, that is why there is a type for buyer in the code. But, there is no unique identifier for buyers and it is difficult to locate them correctly. I also hope to use function to note showings requests, changes, and declined showing requests as well but currently it functions correctly to do the job I need which is automate input for showing inquiries and then create a task reminding deal owner to follow up with them if they have not submitted feedback. 

Again, as a non-coder and non-developer, I am open to suggestions or improvements. Add me on Cliq: patrick@just3k.com