Using emails from customers as SQL queries

I am brainstorming some ideas to make some things at work a bit easier. One thing that happens every day is we get emails from customers asking "Which of my parts are ready?". We have a locally hosted SQL database that tells us this info, and we also store every contact that we work with (about 500) in that same db.

I know we could build a secure way for customers to access the SQL db (create a hosted db, assign user IDs, pwd's, ensure firewall is solid, etc.), but I thought a simpler way might be to create a flow like that shown below. This is NOT working right now. It's more like me scribbling on a whiteboard. Before I do anything, I wanted to get some feedback from the community to see if there is a giant red flag or two that I am missing. I am not looking for help in configuring the actual nodes or debugging / troubleshooting, because I have not built anything yet.

General description is as follows:

  1. We would set up a dedicated email account (something like "status@blah.com")
  2. The incoming emails would have to contain a subject line that follows a specific format, e.g. Which Parts Are Ready? If the email subject did not contain this exact phrase, then it would be rejected.
  3. If it was accepted, then a SQL query would run which sends the sender's email (e.g. robert@abc.com) to SQL and compares against the 500 or so contacts that exist in the database. If it matches, then it returns a 1. If there is no match, then it returns a 0.
  4. If it returns a 1 (i.e. the contact is valid), then another SQL query would run that returns all the parts that are ready for that customer which the contact belongs to
  5. The contents of the above SQL query would be sent via an email to the sender's email address.

The flow would look something like this:

The general idea looks good.
I would start by checking the sender email before continuing.

But what might also be useful is a natural language processor, something like ecolect which you can use to analyse words in the subject or body (less restrictive, customers will make mistakes you know ;)).

Ah, thur be dragons!

Writing natural language and conversational interfaces is a real rabbit hole even for simple requirements.

However, if this data has value, you probably want to do a bit more to make sure that only valid people can get it. You will want to ensure that your email host is well configured and secure. You may want to add some additional checks on the sender.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.