/retool-integration

Mailgun and Retool: Complete Integration Guide 2024

Learn how to integrate Retool with Mailgun to streamline email sending, manage logs, and automate actions using step-by-step guidance for setup and configuration.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Retool apps with your growth in mind.

Book a free No-Code consultation

How to integrate Retool with Mailgun?

 

Integrating Retool with Mailgun

 

Integrating Retool with Mailgun can streamline your email processes by allowing you to trigger emails, manage email logs, and automate actions within your applications. The following detailed guide will help you set up and establish a connection between Retool and Mailgun.

 

Prerequisites

 

  • Access to a Retool account and sufficient permissions to create or modify applications.
  • A Mailgun account with an active domain and API key.
  • Basic knowledge of Retool's interface and the Mailgun API.

 

Creating a Mailgun Resource in Retool

 

  • Log into your Retool account and navigate to the "Resources" tab located in the left-hand sidebar.
  • Click on the "Create New" button to initiate the formation of a new resource.
  • Select "Mailgun API" from the list of available resource types. If Mailgun is not in the list, select a REST API resource since the Mailgun API can be configured through RESTful means.
  • Name the resource to help identify it later (e.g., "Mailgun Email Service").

 

Configuring the Mailgun API Resource

 

  • In the "API URL" field, enter the Mailgun API endpoint you intend to use. Commonly, this is https://api.mailgun.net/v3/YOURDOMAINNAME/messages for sending emails.
  • Add Basic Authentication credentials:
    • Username: "api" (Mailgun's default username for API access).
    • Password: Your Mailgun API key accessible from the Mailgun Control Panel under the "Domains" section.
  • Configure additional settings such as headers if required. For instance, you can set Content-Type: application/x-www-form-urlencoded for form-data submissions.
  • Click on "Test Connection" to verify the setup is correct and Retool can communicate with Mailgun.

 

Creating an Email Sending Interface on Retool

 

  • Navigate to the "Apps" in Retool and open or create a new application where you wish to integrate the mail sending feature.
  • Add form components (e.g., TextInput for "Recipient Email", "Subject", and "Message").
  • Use a Button component labeled "Send Email" to trigger the Mailgun API call.

 

Configuring the API Call to Mailgun

 

  • Select the "Send Email" button and go to its "Click Actions" panel.
  • Add a "Run a query" action selecting the Mailgun resource configured earlier.
  • Set the query type to "POST" since you will be sending data to Mailgun.
  • Define necessary parameters, for example:
    • from: The sender's email address (e.g., "[email protected]").
    • to: Bind this to the TextInput value for the recipient's email.
    • subject: Bind to the TextInput value for the subject line.
    • text or html: Bind to TextInput for the email body content.

 

Testing the Integration

 

  • In Retool, save your application changes and deploy to enter test or preview mode.
  • Use the form to enter the recipient's email, subject, and message, then click the "Send Email" button.
  • Verify that the intended email gets received by checking the recipient's inbox.
  • For troubleshooting, use Retool's query response panel and Mailgun logs.

 

Automating Email Triggers

 

  • Leverage Retool workflows and queries to automate email sending based on specific actions, such as data updates or user interactions.
  • Utilize conditions within queries to customize when and to whom the emails should be sent dynamically based on form inputs or external triggers.

 

By following these detailed steps, you should be able to establish a functional integration between Retool and Mailgun. Ensure you have proper permissions and validate email addresses to avoid deliverability issues.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022