Plug Samples #2 : Prevent junk information by verifying the customer contact details with OTP

Plug Samples #2 : Prevent junk information by verifying the customer contact details with OTP

The chatbot is an excellent way to up stock your business needs. They shine in all the areas you apply them, like conversing with visitors, engaging them on-site, collecting their contact information, etc. Activating your Zobot with a codeless bot platform to collect visitor contact information is easy. But, validating the information and pushing the correct contact details to your CRM for future reference is tedious. In this post, let us learn how to validate the visitor contact information using OTP via plugs. 
  
Plugs help you perform customized actions on the codeless bot platforms. To validate, when a visitor visits your website, you can get their email, generate a unique OTP and allow them to proceed further only if the OTP verification is successful.

Overview of the Plugs:

We need to generate 2 Plugs : 
Plug 1 - For generating unique OTP 
Plug 2 - For verifying the OTP 

How to create a plug:

Plug1 - Generating OTP
  • In your SalesIQ Dashboard, navigate to Settings > Developers > Plugs and Click Add.
  • Provide your plug a name, description. Select the Platform as SalesIQ Scripts, and click on Create Plug
  • Now, create the Plug 1- generating OTP. Click on the parameters on top and declare the following. 
            1. Input Parameter - Name : email | Type : Email
            2. Output Parameter - Name : OTP | Type : Number
  • Copy paste the below code:
  1. response = Map();
  2. email = "";
  3. if(session.containsKey("email"))
  4. {
  5.         email = session.get("email").get("text");
  6. OTP = randomNumber(1000,9999);
  7. }
  8. response = Map();
  9. response.put("OTP",OTP);
  10. return response;
  • Then, click Save, preview the plug and Publish it.
Plug 2 - Verifying OTP
  • Create the Plug 2 - verifying the OTP. Click on the parameters on top and declare the following. 
            1. Input Parameter 1 - Name : emailotp | Type : Number
            2. Input Parameter 2 - Name : visitorotp | Type : Number
            3. Output Parameter : - Name : otpstatus | Type : String
  • Copy paste the below code.
  1. response = Map();
  2. emailotp = "";
  3. visitorotp = "";
  4. emailotp1 = session.get("emailotp").get("value");
  5. visitorotp1 = session.get("visitorotp").get("value");
  6. if(emailotp1 == visitorotp1)
  7. {
  8. otp_status = "OTP verification is Successful";
  9. }
  10. response = Map();
  11. response.put("otpstatus",otp_status);
  12. return response;
  • Then, click Save, preview the plug and Publish it. Now, we have added Plug. 
Note : Only published Plugs will be listed in Codeless Bot Builder. 

Flow to verify OTP on the Codeless Bot platform: 
  1. Initially get the email from the visitor,
  2. Generate a unique OTP using Plug 1,
  3. Send the generated OTP by send mail block
  4. Then get the OTP from the visitor by visitor fields block,
  5. Verify the both OTP (visitor given OTP and plug generated OTP) using Plug 2,
  6. If the OTP verification is successful proceed to the flow, if not, ask the OTP again. 

How to incorporate Plugs in Codeless bot?
  • Navigate to Settings > Bot >Add, enter the necessary information and select Codeless Bot as bot platform or open an existing bot.
  • Select the Plugs block under Action Block and select the Plug 1 (Generate OTP)
  • Provide bot context for email as plug input and get the OTP as plug output and store in bot context (emailotp). 
  • Click Save

  • Now, with Send email block, send an email to the visitor with OTP got from the Plug 1 using bot context (emailotp). 
  • Next, using the visitor fields block, get the OTP from the visitor and save it using the bot context (visitorotp) to verify. 
  • Then, select Plug 2, to verify the OTP created from Plug 1 (emailotp) and OTP entered by the visitor (visitorotp.)
  • Provide both emailotp and visitorotp as Plug input and get the verification successful text from as Plug output and store it in bot context to use it further. Click Save.


Related Links:
To know more about the features of zobot, kindly visit our Resources Section. 

    • Sticky Posts

    • Optimizing Chatbot Versatility by Combining Answer bot and Zobot

      Hi everyone! Great to see you. We are delighted to introduce the Answer bot card/autopilot function for the Codeless and SalesIQ Script bot platforms. This provides your bot with Q&A capabilities similar to the Answer bot. So, you can bring your Answer
    • What will happen if we deploy two Zobots/Chatbots on the website?

      Hi everyone,  The chatbot is a powerful tool to automate customer interaction on your website. But, what will happen if we deploy two different chatbots on the website? If you've deployed both answer bot and Zobot on the website for the same flow, then