Reflex Build

This guide shows you how to integrate Mailtrap with your Reflex Build application to send emails.

Mailtrap is an email-sending solution for developer and product teams. Focused on fast delivery and high inboxing rates for transactional and promo emails. Provides highly customizable API and 24/7 tech support.

Prerequisites

  • A Reflex Build account and a project

  • A Mailtrap account for sending emails

1

Create a landing page/contact form

Log in to your Reflex Build account and use a prompt like the following one to create a simple project with basic fields:

create me a simple contact form with email, name, and message fields, and a send button

2

Add your Mailtrap credentials

After a minute or two, Reflex Build will generate your project. Once it's done, you need to insert your Mailtrap credentials.

To do this, open Settings in the sidebar, navigate to Secrets, and click on the Add new variable button.

Reflex Build Settings showing Secrets tab with Add new variable button highlighted
Reflex Build Secrets settings

You need to add the following two variables:

MAILTRAP_API_TOKEN

This is the Mailtrap API token, which you can create at any time in your account dashboard.

Reflex Build secret configuration showing MAILTRAP_API_TOKEN variable
API Token secret

MAILTRAP_FROM_EMAIL

This is the email address with the verified Mailtrap sending domain you've added after creating an account.

Reflex Build secret configuration showing MAILTRAP_FROM_EMAIL variable
From Email secret

Once you're done adding the variables, simply tell the Reflex Build AI that you're done with a prompt like this one:

I've added the MAILTRAP_API_TOKEN and MAILTRAP_FROM_EMAIL variables

The AI will then go over Mailtrap Email API documentation, connect it to your project, and confirm once it's done.

3

Start sending emails

Finally, to test your configuration, fill out the form and hit the Send button. If you followed everything thus far, you should receive the email in your inbox in a few seconds.

Gmail inbox showing received email from Reflex Build contact form
Email received in Gmail

You can also view the email in the Email Logs tab in the Mailtrap dashboard.

Last updated

Was this helpful?