I set up an automation to watch my emails, I then ...
# 🌎general
b
I set up an automation to watch my emails, I then set up a http request wich send the email contents to botpress webhook, All i need now is for the contents of the webhook from the email to be automatically pasted into botpress so the KB can reply the question in the email. This is what I have so far and I'm now stuck.
a
hi mani, do you know what you're sending to the webhook? The easiest way to find out is to add an execute code directly after the webhook. In the execute code you have to log the event by adding
console.log(event)
(screenshot attached). That code will allow you to see what's coming from gmail in the cloud admin dashboard logs (screenshot attached)

https://cdn.discordapp.com/attachments/1147262554897387661/1147274621897408632/Admin_Dashboard_Logs.png

https://cdn.discordapp.com/attachments/1147262554897387661/1147274622140690493/Execute_Code_snippet.png

b
Yes, I'm sending the contents of the email to the web hook
a
Yes, but can you check what the bot recognizes is being sent? 👆 the steps above is how we find out what the bot is receiving
b
Ah I see, So should I add the execute code right after the trigger?
a
yes, to see what is coming to botpress from the webhook
b
This si what I get

https://cdn.discordapp.com/attachments/1147262554897387661/1147275940871802971/Hello.png

I'm not sure exactly what it means
I was talking to Bassam, one of your engineers the other day and we were discussing how we can do this
f
Hi @bulky-rocket-25360 how are sending the data to botpress?
b
I'm using a http request
from make.com
f
to which url?
b
to send the contents of the email to botpress webhook
f
by webhook you mean the url you got from the webhook integration?
b
Yes
f
is that data being received in you bot?
have you confirmed that part?
b
I'm not exactly sure
I sent a ss of what the log looks like when I send an email
Like this

https://cdn.discordapp.com/attachments/1147262554897387661/1147279768102916127/Hello.png

f
Well it looks like your data is being received but you're trying to do something afterwards that's not working
can you share a screenshot of your studio?
b
Sure!

https://cdn.discordapp.com/attachments/1147262554897387661/1147282637279469648/Screenshot_2023-09-01_160843.png

My main objective is to automate answering email queries for a client of mine
So when they recive emails in their inbox about a question, the email is sent to botpress and the botpress knowledge base that is in the chatbot will have a reply for the question and sent it back to the sender.
The only part I'm struggling with is actually automating the email contents being pasted into the botpress chatbot
f
What are you doing in your execute code block?
b
workflow.makeSuccess = false const leadData = { KnowledgeBaseAnswer: turn.KnowledgeAgent.answer, } try { const response = await axios.post('https://hook.us1.make.com/1vqz8wx7bxs12cuc8cylpe6ciqx81gih', leadData) console.log(response.data) workflow.makeSuccess = true } catch (error) { console.error(error) }
sending knowledge base response back to the sender of the email
Any news?
13 Views