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:
response = Map();
email = "";
if(session.containsKey("email"))
{
email = session.get("email").get("text");
OTP = randomNumber(1000,9999);
}
response = Map();
response.put("OTP",OTP);
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.
response = Map();
emailotp = "";
visitorotp = "";
emailotp1 = session.get("emailotp").get("value");
visitorotp1 = session.get("visitorotp").get("value");
if(emailotp1 == visitorotp1)
{
otp_status = "OTP verification is Successful";
}
response = Map();
response.put("otpstatus",otp_status);
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:
- Initially get the email from the visitor,
- Generate a unique OTP using Plug 1,
- Send the generated OTP by send mail block,
- Then get the OTP from the visitor by visitor fields block,
- Verify the both OTP (visitor given OTP and plug generated OTP) using Plug 2,
- 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: