Create a webhook trigger to send an email

Saltillo Chat Software version 2.15 added an Action to create and send a Webhook Trigger from a button within a vocabulary file on the NOVA chat or ChatFusion device.  In this example of a Webhook Trigger, we are using a Saltillo NOVA chat.  These steps will also work with a Chat Fusion. 

We will be triggering an email to be created, adding a Subject to the email from the Button Message and adding Content to the email from the Speech Display Bar (SDB) of the NOVA chat.

NOTE: You will need a PC or Laptop, a gmail account, the website of www.IFTTT.com, the Chat Editor application (not necessary but helpful) and a NOVA chat device that is connected to a Wi-Fi signal

Creating Gmail Link and Commands

  1. Go to the website www.IFTTT.com
  2. Click on Sign up (If you already have an account, proceed to step # 4)
  3. You can sign in using either your Facebook, Google accounts or just click Sign up
    1. Enter in an email address, password & if you wish to get updates and click Sign up
    2. You will now see a section where you can choose at least 3 of the more frequently used apps or you can click on the X at the top right to not choose.
  4. Click on your name at the top right
  5. Choose New Applet
  6. Now, click on the +This
    1. In the box “Search service” type in Webhooks
  7. Click on Webhooks
  8. Now, click on Receive a web request
  9. Enter in a name of the event     
    1. This can be anything you wish to title the Webhook, for this example we will use Susan Address
    2. Click Create trigger
  10. Click on +That
    1. This is a list of apps that can be used with Webhooks.
    2. In the search services, type in Gmail
  11. Click on Gmail
  12. From this screen, you can choose what you would like to do with the email.
    1. Choose Send yourself an email
  13. On the Complete Action fields screen, do the following:
    1. In the Subject area, highlight all the text and delete
      1. Click Add Ingredient
      2. Click on Value 2 (This will be the message of the button)
    2. In the Body area, highlight all the text and delete
      1. Click on Add ingredient
      2. Click on Value 1 (This will be the SDB)
    3. Click on Create action
  14. Review what you have created and click on Finish
  15. Click on My Applets at the top left of the screen
  16. Tap on Services, then do a search for Webhooks
    1. Click on Webhooks
  17. Click on Documentation on the right side
  18. On this page, you will see some gray areas with boxes
    1. In the first gray area, in the box with the word {event} in it, type in the name of the event you created. In this example, we used Susan Address. Make sure it is spelled exactly the same as 9a above
    2. You can then click on Test it (bottom left), it should say an event has been triggered.
  19. In the third gray area, you will see a URL.
    1. Copy everything after POST.  Example : https://maker.ifttt.com/trigger/email/with/key/pP7ojOyvdbsMXbSe59GIdKOggMAEJWPDTECKVrnUe2c
    2. Open a word document and paste it there for safe keeping.

 Adding the Link and Command to a NOVA chat button

The easiest way to create the webhook is to do it using the Chat Editor to modify the NOVA chat user’s custom vocabulary file. You can do it on the device, but keep in mind that the URL has to be entered in exactly and using the copy/paste feature on the PC will eliminate the proper typing needed. The webhook trigger will not work from the Chat Editor.  Once programmed, the user’s vocabulary file will need to be copied back to the device to trigger the webhook.

For this example, we are using the Chat Editor.

  1. Open the Chat Editor to the appropriate configuration.
  2. Open the latest NOVA chat user’s custom vocabulary file you wish to add the webhook to
  3. Enter Edit mode and create, or edit, the button you wish to use for the webhook
    1. Add a label to the button (if wanted)
    2. Add a picture to the button (if wanted)
    3. In the message of the button type the text you want as the Subject of your email
    4. Go to Actions
    5. Choose Webhooks from the actions drop down menu & tap Add
  4. In the URL area, copy and paste the URL you put on the word document from the website
  5. When that is copied, click on the JSON text area
  6. In the IFTTT website, we set value 1 as the body of the email and value 2 is set as the subject
    1. Enter in the code exactly like the following:

{“value1”:”${MESSAGE}”,”value2”:”${SDB}”}    

(do not copy/paste the JSON command to the editor from this document, type from the device)

Formatting of the JSON command is critical in order for the webhook to work:

  1. It must be enclosed in curly brackets e.g., {“value1”:”${MESSAGE}”,”value2”:”${SDB}”}
  2. There has to be some type of value (this was created when you did the webhook on the IFTTT site)
  3.  The values have to be enclosed in quotes, in all caps and preceded with a dollar sign e.g., “${MESSAGE}” or ”${SDB}”
  4. The location the text is coming from on the NOVA chat must be enclosed in curly brackets e.g., ${MESSAGE} or ${SDB}

If anything is incorrect in the formatting of the JSON code, the editor & device will tell that it is malformed.

7. Click Save

If done correctly, it will save. If something is not set right in the JSON or in the URL line, the device (or editor) will tell you so you can correct it.

8.Once done, click OK and take the editor out of edit mode.

Now, the webhook is programmed to a button. Confirm it is working.

  1. Transfer the custom file over to the NOVA chat that is connected to a WiFi signal
  2. Once on the device, add text to the Speech Display Bar (SDB) that you want to be included in the content of the email (this example would be Susan’s address).
  3. Tap on the webhook button that you created
  4. The email is now sent to yourself
  5. To confirm this, go to the PC and log into your email to see if it is there