/retool-integration

SendGrid and Retool: Complete Integration Guide 2024

Learn how to integrate Retool with SendGrid to send emails using SendGrid's API via Retool's interface through a detailed step-by-step guide.

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 SendGrid?

 

Integrating Retool with SendGrid

 

Integrating Retool with SendGrid involves configuring both platforms to communicate effectively, allowing you to send emails using SendGrid's API via Retool's interface. This detailed guide will take you step-by-step through setting up this integration.

 

Prerequisites

 

  • Ensure you have accounts with both Retool and SendGrid.
  • API keys or required credentials for both services.
  • Basic understanding of API operations and JSON format.

 

Setting Up SendGrid

 

  • Log into your SendGrid account and navigate to the API Keys section under Settings.
  • Create a new API key with appropriate permissions, typically accepting the default "Full Access" for most needs.
  • Copy and securely store your API key as it will only be shown once.

 

Configuring Retool

 

  • Log into your Retool account and open the application where you want to integrate SendGrid.
  • Navigate to the "Resources" section on the left sidebar to manage API credentials.

 

Creating a Resource for SendGrid

 

  • Click on "Create new" and select "REST API" from the list. This allows Retool to send HTTP requests to SendGrid.
  • Under resource setup:
    • Enter a name for your resource, e.g., "SendGridAPI".
    • Set the Base URL to https://api.sendgrid.com/v3.
    • Under "Authentication", select "Bearer Token" and paste your SendGrid API key in the token field.
    • Save the resource to make SendGrid available in your Retool app.

 

Implementing SendGrid in Retool

 

  • Go to your Retool application's editor. You will create a query to send an email using SendGrid.
  • Select the "Queries" pane and then click "New Query". Choose your newly created SendGrid resource.
  • Set the HTTP method to "POST" and use the endpoint /mail/send.
  • In the "Body" tab, input JSON to define the email's content:
        {
          "personalizations": [{
            "to": [{"email": "[email protected]"}],
            "subject": "Hello from Retool!"
          }],
          "from": {"email": "[email protected]"},
          "content": [{
            "type": "text/plain",
            "value": "Hello, this is a test email."
          }]
        }
        
  • You can use Retool's components to dynamically fill in these details using {{}} syntax.
  • Test your query by manually triggering it within Retool to ensure it's functioning correctly.

 

Linking Retool Components to SendGrid

 

  • Add input components (e.g., text fields) in your Retool app to allow dynamic entry of email details.
  • Bind these components to the query you set up, using their values inside the JSON payload. For example, use {{emailInput.value}} to reference an email entered in a text field named emailInput.
  • Create a button in your interface that calls the email-sending query when clicked. Ensure to handle user feedback, such as success notifications upon successful email dispatch.

 

Testing the Integration

 

  • Test the complete workflow by filling in your input fields and triggering the email through the SendGrid query.
  • Verify the email is received by the intended recipient by checking the recipient's inbox.
  • Debug any issues using Retool's console logs for errors or SendGrid's own API response messages.

 

Maintaining and Expanding the Integration

 

  • Regularly review your API key permissions and renew keys if compromised or expired.
  • Expand the integration by utilizing additional SendGrid features like templates or tracking email metrics within Retool.

 

With these steps, you've successfully integrated Retool with SendGrid, allowing seamless email communication directly from your Retool application. Whether sending newsletters, confirmations, or notifications, this setup enables direct and flexible control of your email operations.

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