Some weeks ago I got a customer requirement for an extended email validation. We should confirm that the email was valid and existed. Within ODA we offer email validation with the built-in Email Entity. This entity validates the Email format but it does not assert if it actually exists.
The requirement here was to actually confirm the email existence.
For that we can use one of the many available services out there that do email verification and validation (like Twilio/SendGrid for example). Since this was for demo purposes I went to RapidAPI to look for a simple service.
There are many available options, most of them with a freemium plan, which allows to test for free up to a certain threshold. I used this one.
Bot Node.JS SDK Code
Below a sample code to implement email verification
Dialog Flow
From the Dialog Flow we call the custom component and define the transitions based on the outcome.
validate_email:
component: "validate_email"
properties:
email: "${email.value}"
transitions:
actions:
valid: "next_step"
notvalid: "goback_and_ask_again_for_email"
na: "error or unavailabe"
This is a very simplified implementation but one could add max-prompts and prompt variation in the custom component code as well.