Leap.new and Mailtrap Integration

Send Emails with Leap.new and Mailtrap

Step-by-step guide on how to integrate Mailtrap with your Leap.new application.

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 Leap.new account and a project.
  • A Mailtrap account for sending emails.

Step 1. Create a landing page/contact form 

Log in to your Leap.new 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

Step 2. Add your Mailtrap credentials

After a minute or two, Leap.new will generate your project. Once it’s done, you need to insert your Mailtrap credentials.

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

Once there, use the New secret button 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. And here’s what the variable should look like:
  • MAILTRAP_FROM_EMAIL – This is the email address with the verified Mailtrap sending domain you’ve added after creating an account. And here’s the variable:

Once you’re done adding the variables, simply tell the Leap.new AI that you’re done with a prompt like this one, for example:

i've added the MAILTRAP_API_TOKEN and MAILTRAP_FROM_EMAIL secrets

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

Important: If you haven’t already, make sure to let AI know you want the messages to be sent to the address inputted in the email field. For this, you can use a prompt such as this one:

i want the message to be sent to the address inputted in the email field, meaning the to field should use the email from the form data

Step 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. Here it is in a Gmail inbox:

And here it is in the Email Logs tab in the Mailtrap dashboard.

Before you go: If you plan on collecting email addresses for a list, you can connect your Reflex Build project with Mailtrap Contacts and store your addresses in the Mailtrap dashboard automatically. For reference, check out the official Mailtrap Contacts API documentation.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us