Taking Emails and pasting contents into a chatbot
# 🤝help
b
I want to take emails that are sent and take the contents of the email and paste it into a chatbot, is this possible to automate?
m
I use zapier (or make) / execute code
b
Thats what I was planning on, any chance you can teach me how you did it?
m
here is my execute code
workflow.makeSuccess = false; const leadData = { name: workflow.name, email: workflow.email, BusinessName: workflow.BusinessName, Industry: workflow.Industry, Website: workflow.Website, Goals: workflow.Goals, aiDesiredOutcomes: workflow.aiDesiredOutcomes, aiBizOverview: workflow.aiBizOverview, TypeOfVideo: workflow.TypeOfVideo, NarrativeFramework: workflow.NarrativeFramework, Concept: workflow.Concept, aiMarketingPlan: workflow.aiMarketingPlan, final: workflow.final }; try { const response = await axios.post('https://hooks.zapier.com/hooks/catch/YOURWEBHOOK', leadData); workflow.makeSuccess = true; } catch (error) { console.error(error); }
my variable naming is terrible, don't be ike me lmao
b
Isn't this for taking the users responses and storing them in a google sheet?
m
@bulky-rocket-25360 yep I def misunderstood you
Can you elaborate a bit on what you want. Emails that are sent by who? Can you give me an example?
b
Sure, So I have a client that is a nutritionist, she wants a chatbot on her site. She told me if it's possible to answer questions directly from her email (because this is where she spends the most time answering questions) So I thought if it would be possible do that, I noticed that botpress is already working on a gmail integration but I knew there was a way without that. Here is what I was thinking: 1. Someone sends an email to my client 2, A software called Make.com goes off because it is watching her email (everytime a new email comes in it goes off) 3. The contents of the email are sent to a google sheet and then to a botpress webhook using a http request from make.com 4. the contents of the email are AUTOMATICALLY pasted into the chatbot that has a knowledge base from my clients site 5. The knowledge base answers the contents of the email (the question)" 6. Using an execute code block, the answer of the knowledge base (Stoed in turn.KnowledgeAgent.answer) is sent to a make.com webhook 7. The webhook captures that answer and sends it back to the email of the person using turn.knowledgeAgent.answer as the contents of the email My only bottleneck is how to automatically paste that message in the chatbot and how to trigger the chatbot from the botpress webhook
4 Views