Configuring Email Verification

Enable verification for your production applications

Configuring your deployment to require email verification helps keep your deployment secure, prevents unauthorized account creation, reduces spam registrations, and ensures you have valid contact information for your users.

Currently, R2R has integrations for both Mailersend and Sendgrid.

Setup

Both Mailersend and Sendgrid require registration, but do offer free tiers for evaluating their services. Create an account with your desired provider, and generate an API key.

Creating a Template

Once you have registered for an account with your email provider, you will want to create an email template. Providers will have pre-made templates, or you can build these from scratch.

A Mailersend welcome template.

Once you save a template, you will want to make note of the template id. These will go into the configuration files.

Configuration Settings

We can then configure our deployment with the templates, redirect URL (frontend_url), and from email.

Configuration File

1[email]
2provider = "mailersend"
3verify_email_template_id="3zxk54v157z4jy6v"
4reset_password_template_id="jy7zpl9wrn545vx6"
5password_changed_template_id="3z0vklop5npg7qrx"
6frontend_url="https://app.rowland.ai/auth"
7from_email="[email protected]"

Environment Variables

It is required to set your provider API key in your environment:

1export MAILERSEND_API_KEY=…
2export SENDGRID_API_KEY=…