{"id":4156,"date":"2023-05-10T10:07:02","date_gmt":"2023-05-10T08:07:02","guid":{"rendered":"https:\/\/botnation.ai\/how-to-check-an-email\/"},"modified":"2026-01-02T15:28:22","modified_gmt":"2026-01-02T14:28:22","slug":"how-to-check-an-email","status":"publish","type":"support","link":"https:\/\/botnation.ai\/en\/support\/how-to-check-an-email\/","title":{"rendered":"How to check an email"},"content":{"rendered":"<p>Is an email given by the user valid?<\/p>\n\n\n\n<p>Your chatbot \u2013 that<strong> powerful lead collection tool<\/strong> \u2013 collects a lot of email addresses to populate your database. Only you realize that some emails are wrong or misspelled, so they are unusable. You can therefore check these email addresses beforehand by sending a verification code. This is very simple to set up \ud83d\ude09<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">1. The process<\/h2>\n\n\n\n<p>The principle is to send a 4-digit number randomly generated thanks to the <a href=\"https:\/\/botnation.ai\/en\/generate-a-random-value-for-a-variable\/\" target=\"_blank\" rel=\"noreferrer noopener\">native functionality<\/a> of Botnation, this code (received on the mailbox) will be transferred to the chatbot. The latter, by a simple condition, will check if the typed code is equal to the sent code. A practical example is available on the chatbot <a href=\"https:\/\/agence-chatbot.fr\/\" target=\"_blank\" rel=\"noreferrer noopener\">Agence Chatbot<\/a>.<\/p>\n\n\n\n<p>If yes, then the user will continue to progress in the chatbot, if not, then he will be proposed to go back to the previous step and fill in a valid email.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. The implementation<\/h2>\n\n\n\n<p>In the sequence dedicated to the recovery of the email field, create a user entry with a variable, for example {{EMAIL}} and add the option \u201cEmail detection\u201d in \u201cVariable type\u201d. Thus, the chatbot will recognize the presence of an \u201c@\u201d. If the \u201c@\u201d is missing, then the user entry will not be validated. Then, redirect the user to an \u201cEmail Code\u201d sequence in which we will set up the sending of the 4 digit number.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-86-1024x913.png.webp\" alt=\"\" class=\"wp-image-4165\" style=\"width:601px;height:535px\"><\/figure>\n<\/div>\n\n\n<p>To do this, add the \u201cRandom\u201d function represented by a die and present in the \u201cVariables\u201d set<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-87.png.webp\" alt=\"\" class=\"wp-image-4167\"><\/figure>\n<\/div>\n\n\n<p>Create a user variable, for example {{CODE_EMAIL}} and choose to generate a number \u2013 randomly \u2013 between 1000 and 9999 so that it sends a 4-digit code, then redirect to a new sequence that will be used to send this random number.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-88-1024x327.png.webp\" alt=\"\" class=\"wp-image-4169\" style=\"width:652px;height:207px\"><\/figure>\n<\/div>\n\n\n<p>Choose the email module that suits you from the different native plugins of Botnation<a href=\"https:\/\/botnation.ai\/en\/?p=3257\">(Gmail<\/a> or <a href=\"https:\/\/botnation.ai\/en\/?p=3784\">Mailgun<\/a>). In this example, we choose Gmail :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-187.png.webp\" alt=\"\" class=\"wp-image-7385\"><\/figure>\n<\/div>\n\n\n<p>Then fill in your sending email \u201cFrom\u201d and the variable {{EMAIL}} previously recovered in the recipient part \u201cTo\u201d. In the body of the email, add the variable {{CODE_EMAIL}} previously generated. The content of the email is yours, write what you want \ud83d\ude09<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-89-948x1024.png.webp\" alt=\"\" class=\"wp-image-4171\" style=\"width:511px;height:552px\"><\/figure>\n<\/div>\n\n\n<p>Ditto, add a text part to explain the process to your user (what is this code for, what are the next steps\u2026).<\/p>\n\n\n\n<p>The chatbot will send an email with the code to the indicated email.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-90.png.webp\" alt=\"\" class=\"wp-image-4173\" style=\"width:520px;height:308px\"><\/figure>\n<\/div>\n\n\n<p>Then, add a user input to type the code received in the email and trigger the code verification condition. To do this, we need to create a dedicated variable, for example {{CODE_EMAIL_RECU}} choose number detection in \u201cVariable type\u201d (so if letters are written, it won\u2019t work) and redirect to a new sequence that we will use to do the verification:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-91-1024x675.png.webp\" alt=\"\" class=\"wp-image-4175\" style=\"width:559px;height:368px\"><\/figure>\n<\/div>\n\n\n<p>Finally, set up the following conditions using the \u201cif\u201d function in the \u201cVariables\u201d module:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If the email code sent by the chatbot is equal to the code typed by the user, then the chatbot redirects to the thank you sequence<\/li>\n\n\n\n<li>Otherwise, the chatbot redirects to a sequence proposing to repeat the action.<\/li>\n<\/ul>\n\n\n\n<p>This is characterized as follows:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/05\/image-92-1024x521.png.webp\" alt=\"\" class=\"wp-image-4177\" style=\"width:639px;height:324px\"><\/figure>\n<\/div>\n\n\n<p>It\u2019s done!<\/p>\n\n\n\n<p>In just a few steps and without any code, you have set up an efficient email verification. From now on, misspelled or false emails will no longer be sent to your database.<\/p>\n\n\n\n<p><strong>Plus:<\/strong><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/all-about-variables\/\">All about variables<\/a><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/the-if-condition-feature\/\">IF conditions<\/a><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/generate-a-random-value-for-a-variable\/\">Generate a random value<\/a><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/get-an-email-and-a-phone-number-from-a-facebook-messenger-chatbot\/\">Get an email and a phone number from a Facebook Messenger chatbot<\/a><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/check-a-phone-number\/\">How to check a phone number<\/a><\/p>\n\n\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false},"categorie-support":[198,221],"class_list":["post-4156","support","type-support","status-publish","hentry","categorie-support-tutorials","categorie-support-web-chatbot-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/support\/4156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/support"}],"about":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/types\/support"}],"wp:attachment":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/media?parent=4156"}],"wp:term":[{"taxonomy":"categorie-support","embeddable":true,"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/categorie-support?post=4156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}