Search code examples
phptwilionode-redwatsonwatson-conversation

Send SMS / Email from Watson Assistant (Converstion)


I am currently developing a little chatbot using IBM Watson assistant. While I'm quite used to entities and intents etc... I really lack experience on how to link to bot to external services.

Long story short, my bot will ask for a phone number and an email address, but I can't get my head around on how to make the bot communicate with the outside world.

I have a Twilio account for, but I can't find any doc on how to send a message from the bot without going through Node-Red (and also in that case the docs are scarce).

For Emails, I thought I could use this, maybe calling a PHP file with Emailer?

Consider that the bot is integrated with Wordpress right now, using only the Watson assistant credentials.

Thanks a lot in advance for your help


Solution

  • My 5 pence advice:

    1. run node-red in the cloud (see the bottom left section of page https://nodered.org/docs/getting-started/). E.g. I recommend the Node-Red Starter Boilerplate on IBM Bluemix (which is now called IBM Cloud) as you are already using the IBM Cloud service "IBM Watson Assistant".
    2. Within node-red, you have specific nodes for the communication with IBM Watson assistant, email, Twilio.
    3. Somehow you must integrate node-red (not Watson assistant) with Wordpress if that is what you want to use as conversation interface.
    4. In IBM Watson assistant you can set context variables containing the phone number and email address that has been gathered during the conversation.
    5. The node-red application has access to the data in those context variables (see the previous point) and can use that, for instance, to send an email to that specific address.