![]() This is a feature of SendGrid's dynamic templates. The API will automatically replace this with the token before sending the email. Notice how we can use Mustache variables in our template to substitute the auto-generated token in the twilio_code variable. Select the Code Editor and paste the body of our email into the editor on the left. Our template will be in HTML only, but in a production system, we'd also want to create text versions of our email. Click on the newly created template and Add Version then select a Blank Template. We can name our template anything we want it's just a friendly name for us to recognise the template. Head to the Dynamic Templates section of the SendGrid dashboard and click the Create a Dynamic Template button. We'll be using SendGrid to send our verification emails, and Twilio to trigger the verify actions, so before we start we'll need an email template in our SendGrid account that we can use to send out our token. Your SendGrid Account SID in an environment variable.Your Twilio Account SID and Token in environment variables.It leaves us free to solve our specific business problems and not spend our energy solving problems that we don't need to. Once our user has clicked the link, we can validate the token is correct with another API call. Luckily for us, Twilio Verify now supports email verification so we can send email verification requests complete with an auto-generated token with a single API call to Twilio. But nobody wants to configure and maintain a mail server to send out email verification requests. Creating the forms and handling the data entry is relatively easy in PHP we have libraries and frameworks that can help with these everyday tasks. Typically we'll verify the email address by sending an email to that address with a unique token as a query parameter in a link that the recipient should click. ![]() As web developers, we end up creating a ton of login systems, and part of the “create user” flow is invariably verifying that the email address entered by the user is real, and owned by that person.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |