Skip to main content
RapidDev - Software Development Agency
retool-integrationsRetool Native Resource

How to Integrate Retool with SendGrid

Connect Retool to SendGrid using the native SendGrid Resource in the Resources tab. Authenticate with your SendGrid API key, then use the query editor's operation dropdown to send transactional emails, manage contacts and lists, view delivery statistics, and monitor bounces — all from within your Retool operational dashboards without any API endpoint knowledge.

What you'll learn

  • How to add a SendGrid Resource using an API key in the Retool Resources tab
  • How to send transactional emails with dynamic content from Retool query data
  • How to use dynamic templates to send branded, pre-designed emails from operational dashboards
  • How to query email delivery events to monitor bounces, opens, and failures
  • How to manage contacts and marketing lists from a Retool admin panel
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner16 min read10 minutesCommunicationLast updated April 2026RapidDev Engineering Team
TL;DR

Connect Retool to SendGrid using the native SendGrid Resource in the Resources tab. Authenticate with your SendGrid API key, then use the query editor's operation dropdown to send transactional emails, manage contacts and lists, view delivery statistics, and monitor bounces — all from within your Retool operational dashboards without any API endpoint knowledge.

Quick facts about this guide
FactValue
ToolSendGrid
CategoryCommunication
MethodRetool Native Resource
DifficultyBeginner
Time required10 minutes
Last updatedApril 2026

Why Connect Retool to SendGrid?

Support teams, operations managers, and customer success staff frequently need to send transactional emails as part of their workflows — password reset links, order confirmation resends, onboarding instructions, or escalation notifications. Without a Retool-SendGrid integration, this typically means switching between Retool for the operational data and a separate email tool or support system for the messaging. Connecting SendGrid to Retool collapses this into a single interface: your team sees the customer data and can send the email in the same click.

Retool's native SendGrid connector handles the API key authentication and surfaces the most common email operations through a dropdown rather than requiring your team to know SendGrid's REST endpoint structure. This means less-technical ops team members can use the integration effectively after a brief setup, not just the engineers who built the tool.

Beyond ad-hoc email sending, the integration opens up powerful monitoring workflows. Operations and deliverability teams can build dashboards that pull SendGrid's event data — showing bounce rates, spam complaints, unsubscribes, and open rates for specific campaigns or date ranges — alongside your internal customer database. This creates a unified deliverability monitoring panel that surfaces problems before they affect sender reputation.

Integration method

Retool Native Resource

Retool includes a dedicated SendGrid connector that authenticates via API key and exposes SendGrid's core email operations through a dropdown interface — send emails, list contacts, add to lists, and query delivery events. All requests are proxied through Retool's server-side backend, keeping your SendGrid API key secure and eliminating any CORS concerns. No endpoint paths or request body formats need to be memorized.

Prerequisites

  • A Retool account (Cloud or self-hosted) with permission to add Resources
  • A SendGrid account (free tier supports 100 emails/day; paid plans for higher volume)
  • A SendGrid API key with appropriate permissions — at minimum: Mail Send (Full Access), Suppressions (Full Access), and Marketing (Read Access if using marketing lists)
  • For dynamic template emails: at least one SendGrid Dynamic Template created in the SendGrid Dashboard under Email API → Dynamic Templates

Step-by-step guide

1

Create a SendGrid API key and add the Resource

Start by creating a dedicated API key for your Retool integration in SendGrid. Log into app.sendgrid.com, navigate to Settings → API Keys, and click Create API Key. Give it a name like 'Retool Integration' so you can identify it later. Select Restricted Access and configure the specific permissions your Retool apps will need: - Mail Send: Full Access (required to send emails) - Suppressions: Full Access (required to read and manage bounces/blocks) - Marketing → Contacts: Full Access (required to manage contact lists) - Stats: Read Access (required for email analytics queries) Avoid granting Full Access at the top level — restrict to only what your Retool dashboard actually uses, following the principle of least privilege. Copy the generated key immediately, as SendGrid only shows it once. Now open Retool and navigate to the Resources tab. Click Add Resource and search for or scroll to 'SendGrid'. Click SendGrid to open the configuration form: - Name: enter a clear name like 'SendGrid Production' - API Key: paste the key you just created Click Save Changes. The SendGrid resource is now available in the query editor for any Retool app in your organization. If you have both a test SendGrid account and a production one (separate SendGrid accounts with separate API keys), create a second resource for the test environment.

Pro tip: Store your SendGrid API key as a Retool Configuration Variable (Settings → Configuration Variables) marked as 'secret', and reference it in the resource configuration as {{ retoolContext.configVars.SENDGRID_API_KEY }}. This allows rotating the key in one place without updating every resource configuration.

Expected result: A SendGrid resource appears in the Resources list. Creating a query with this resource shows an Action Type dropdown with SendGrid operations like 'Send Email', 'Get Contacts', and 'Get Suppressions'.

2

Send a transactional email from a Retool app

Open a Retool app (or create a new one) and click + New in the query editor to create a new query. Select your SendGrid resource and set the Action Type to Send Email. The query editor reveals a form with the email sending parameters: - To: the recipient email address — reference a component or query field like {{ customerTable.selectedRow.email }} - From: your verified SendGrid sender email address (must be verified in SendGrid Dashboard → Settings → Sender Authentication) - Subject: the email subject line, which can include dynamic values: 'Your order {{ ordersQuery.selectedRow.order_id }} has been shipped' - Body (HTML): the HTML email body. Use a Retool text area component to let users customize the message, referenced as {{ emailBodyInput.value }} - Body (Plain Text): plain text fallback version Set the query's Trigger to Manual mode so it only fires when explicitly triggered, not on page load or when inputs change. Drag a Button component onto the canvas. In the Inspector, go to Interaction → Add Event Handler, set Action to 'Trigger query', and select your send email query. Enable the 'Confirm before running' toggle and set the confirmation message to 'Send email to {{ customerTable.selectedRow.email }}?' — this prevents accidental sends. Test by entering a real recipient email address (your own, during testing) and clicking the button. Check your inbox to verify the email arrived with the correct subject, body, and from address. Check the query run log in Retool's bottom panel to see the SendGrid API response.

Pro tip: Always verify your sender email address in SendGrid (Settings → Sender Authentication) before testing. Emails sent from unverified addresses will fail with a 403 error even if your API key is valid.

Expected result: Clicking the button opens a confirmation dialog. After confirming, the SendGrid query runs and the recipient receives the email. The query run log shows a 202 Accepted response from SendGrid confirming the email was queued for delivery.

3

Use dynamic templates for branded emails

For operational emails that need consistent branding and formatting — password resets, shipping confirmations, invoice summaries — use SendGrid Dynamic Templates rather than building HTML in the query editor. Dynamic Templates let your design team maintain the visual design in SendGrid's template editor while Retool operators fill in the data variables. First, create a Dynamic Template in the SendGrid Dashboard under Email API → Dynamic Templates. Design the template using the SendGrid Design Editor or code editor. In the template body, use Handlebars syntax for variable placeholders: {{ customer_name }}, {{ order_id }}, {{ tracking_url }}. Note the Template ID shown at the top of the template (format: d-xxxxxxxx). In Retool, create a new query using your SendGrid resource. Set Action Type to Send Email. In the form, you'll see a Template ID field — enter the template ID from SendGrid. Below it, a Dynamic Template Data section appears (as a JSON input). Enter the variable values that map to your template's Handlebars placeholders: Set Trigger to Manual and wire the query to a button with a confirmation dialog. When the button is clicked, Retool sends the API request with the template ID and variable data, and SendGrid renders the final email by substituting the variables into the template HTML before delivery.

dynamicTemplateData.json
1// Dynamic Template Data JSON — enter this in the query editor's Template Data field
2// Variables must match the Handlebars placeholders in your SendGrid template exactly
3{
4 "customer_name": "{{ customerTable.selectedRow.first_name }} {{ customerTable.selectedRow.last_name }}",
5 "order_id": "{{ customerTable.selectedRow.order_id }}",
6 "order_date": "{{ new Date(customerTable.selectedRow.created_at).toLocaleDateString() }}",
7 "total_amount": "${{ (customerTable.selectedRow.total_cents / 100).toFixed(2) }}",
8 "tracking_url": "{{ customerTable.selectedRow.tracking_url || 'Not yet available' }}",
9 "support_email": "support@yourcompany.com"
10}

Pro tip: Preview your dynamic template in SendGrid's template editor before using it in Retool. SendGrid's preview feature lets you enter test values for all Handlebars variables and see the rendered output, making it easy to catch formatting issues before the template goes to real customers.

Expected result: Clicking Send triggers a SendGrid email delivery using the branded template with all Handlebars variables correctly populated from the selected Retool table row. The recipient receives a professionally formatted email that matches your template design.

4

Build an email deliverability monitoring dashboard

Email deliverability issues — bounces, spam complaints, and blocks — can damage your sender reputation if left unaddressed. Build a Retool monitoring panel that surfaces these problems by querying SendGrid's suppression lists. Create three separate queries using your SendGrid resource: 1. Get Bounces (Action Type: Get Bounces or List Bounces) — retrieves all email addresses that have hard or soft bounced 2. Get Spam Reports — retrieves addresses that marked your emails as spam 3. Get Blocks — retrieves addresses that were blocked by receiving mail servers Set all three queries to Auto trigger on page load. Drag three Table components onto the canvas, one for each suppression type. In each table's Data source field, set it to the corresponding query's data output. Add a Date Range filter at the top of the page. Wire the start and end date values to all three queries' parameters to filter suppressions by the time period of interest. Add a text summary at the top showing totals: 'Bounces: {{ bouncesQuery.data.length }} | Spam Reports: {{ spamQuery.data.length }} | Blocks: {{ blocksQuery.data.length }}'. For each table, add a row action button: 'Remove from suppression list'. Wire this button to a Delete Suppression query that passes the selected email address and suppression type. Add a confirmation dialog: 'Remove {{ table1.selectedRow.email }} from bounce suppression?' After deletion, add an On Success event handler to re-run the fetch query so the table updates immediately.

suppressionListTransformer.js
1// JavaScript transformer to unify and format suppression data
2// Use this if combining all suppression types into a single table view
3const bounces = bouncesQuery.data || [];
4const spamReports = spamReportsQuery.data || [];
5const blocks = blocksQuery.data || [];
6
7const formatEntry = (entry, type) => ({
8 email: entry.email,
9 type: type,
10 reason: entry.reason || entry.description || '',
11 created: entry.created
12 ? new Date(entry.created * 1000).toLocaleDateString()
13 : 'Unknown'
14});
15
16return [
17 ...bounces.map(e => formatEntry(e, 'Bounce')),
18 ...spamReports.map(e => formatEntry(e, 'Spam Report')),
19 ...blocks.map(e => formatEntry(e, 'Block'))
20].sort((a, b) => b.created - a.created);

Pro tip: Schedule a Retool Workflow to check suppression counts weekly and post a Slack summary to your operations channel — this surfaces deliverability problems passively without requiring someone to open the dashboard regularly.

Expected result: A dashboard shows three panels of suppressed email addresses, organized by type. The header shows totals for each category. Operations staff can filter by date range and remove addresses from suppression lists directly from the interface.

5

Manage contacts and marketing lists from Retool

For marketing and growth teams that manage SendGrid marketing lists, Retool can provide a more flexible interface for adding, removing, and auditing contacts than SendGrid's own Marketing Campaigns UI, especially when contact data needs to be cross-referenced with your internal database. Create a query using Action Type Get All Lists to fetch your SendGrid marketing lists. Wire the result to a Select component on the canvas so the user can choose which list to work with. Create a second query using Get Contacts (or Search Contacts) — configure the List ID parameter to reference {{ listSelector.value }}. Set this query to run automatically when the list selector changes, so the contact table updates whenever the user switches lists. To add contacts to a list, create an Add Contacts query. In the query body, pass the contacts array referencing selected rows from your database: {{ selectedDatabaseContacts.data.map(c => ({ email: c.email, first_name: c.first_name, last_name: c.last_name })) }}. Wire this to an 'Add to List' button that only enables when rows are selected in your database contacts table. Important: SendGrid's Add Contacts operation is asynchronous — it returns a job ID, not immediate confirmation. To handle this, create a follow-up query using Get Contact Import Status that polls with the returned job ID. Alternatively, simply show a 'Contacts queued for import' message via a Show Notification event handler, making it clear to the user that there may be a brief delay before contacts appear in SendGrid.

contactsImportTransformer.js
1// JavaScript transformer to prepare contacts for SendGrid bulk add
2// Use this to reshape your internal database contact records
3// into the format SendGrid's Add Contacts API expects
4const internalContacts = databaseContactsQuery.data || [];
5
6return internalContacts
7 .filter(contact => contact.email && contact.email.includes('@')) // basic email validation
8 .map(contact => ({
9 email: contact.email.toLowerCase().trim(),
10 first_name: contact.first_name || '',
11 last_name: contact.last_name || '',
12 custom_fields: {
13 // Map your internal fields to SendGrid custom field IDs
14 // Custom field IDs are found in SendGrid → Marketing → Custom Fields
15 e1_T: contact.account_tier || '', // example custom field
16 e2_D: contact.signup_date || '' // example date custom field
17 }
18 }));

Pro tip: SendGrid's Marketing Contacts and Transactional Email use separate APIs and separate contact storage. Contacts you add to Marketing lists are not automatically the same as email addresses you send transactional emails to — the two systems are independent in SendGrid's architecture.

Expected result: The contact management panel shows marketing lists in a dropdown selector. Selecting a list loads its contacts in the table. The 'Add to List' button is enabled when database rows are selected and successfully queues the import to SendGrid with a confirmation notification.

Common use cases

Build a customer email operations panel

Create a Retool app where support agents can look up any customer from your database, view their recent email history, and send a templated email directly from the panel. The agent selects the email type (password reset, order confirmation, account activation), the Retool form pre-fills the template variables from the customer record, and clicking Send triggers the SendGrid query. No switching between systems is needed.

Retool Prompt

Build an email operations panel that shows a customer search input. When a customer is selected, display their account details and recent email history from the SendGrid events log. Include buttons to resend common transactional emails (password reset, account activation) using SendGrid dynamic templates with the customer's data pre-filled.

Copy this prompt to try it in Retool

Monitor email deliverability with a bounce dashboard

Build a Retool dashboard that queries SendGrid's suppression lists and event data to show bounced, blocked, and spam-flagged email addresses. The dashboard lets your deliverability team see which addresses are causing issues, add notes about remediation steps in an internal database, and remove addresses from suppression lists directly from the interface. This is faster than navigating SendGrid's own dashboard for each address.

Retool Prompt

Create a deliverability monitoring dashboard that fetches all blocked and bounced email addresses from SendGrid with the reason and date. Add a filter for bounce type (hard, soft, block). Include a 'Remove from suppression' button that calls the SendGrid delete suppression API and logs the removal action in the internal tracking table.

Copy this prompt to try it in Retool

Automated re-engagement email workflow

Build a Retool app that identifies customers who haven't been active in 30+ days using a database query, previews the list with their last activity date, and lets a marketing manager click 'Send Re-engagement Campaign' to add those contacts to a SendGrid marketing list and trigger a pre-built email sequence. The app shows how many contacts were added and confirms the campaign was triggered.

Retool Prompt

Create a re-engagement workflow panel. Query the database for users with last_active_date older than 30 days and no account cancellation. Show the list with checkboxes. When the manager selects contacts and clicks 'Add to Re-engagement List', call SendGrid's Add Contacts to List API and show a success summary of how many contacts were queued.

Copy this prompt to try it in Retool

Troubleshooting

Send Email query returns '403 Forbidden' with message 'The from address does not match a verified Sender Identity'

Cause: The email address in the 'From' field of your query is not verified in SendGrid. SendGrid requires sender email addresses to be verified via Domain Authentication or Single Sender Verification before they can be used to send email.

Solution: Go to the SendGrid Dashboard → Settings → Sender Authentication. Complete either Single Sender Verification (verify a specific email address) or Domain Authentication (verify your entire sending domain, recommended for production). Use only verified email addresses in Retool's SendGrid query From field.

Dynamic template email sends successfully but recipient receives the email with unreplaced Handlebars placeholders (e.g., '{{ customer_name }}' shown literally)

Cause: The JSON keys in the Dynamic Template Data field do not exactly match the variable names in the SendGrid template's Handlebars syntax, including case sensitivity.

Solution: Open the SendGrid Dynamic Template editor and check the exact spelling and case of every Handlebars variable (e.g., {{ customer_name }} vs {{ customerName }}). Update the JSON keys in Retool's Dynamic Template Data to match exactly. Handlebars variable names are case-sensitive — customer_name and Customer_Name are different variables.

Get Contacts or Get Suppressions query returns an empty array but data clearly exists in SendGrid

Cause: The API key does not have the required read permissions for that endpoint, or you are querying the wrong endpoint type (Marketing contacts vs. Transactional suppressions use different API paths).

Solution: Verify your SendGrid API key permissions in SendGrid Dashboard → Settings → API Keys → click your key → check the permissions list. For suppression lists, the key needs Suppressions → Read Access. For Marketing contacts, it needs Marketing → Read Access. Create a new key with the correct permissions if needed, update the Retool resource configuration, and re-run the query.

Best practices

  • Always use SendGrid Dynamic Templates for customer-facing emails — they keep HTML and branding under design team control and separate from Retool's operational logic.
  • Create a restricted SendGrid API key for each Retool environment (development and production) with only the permissions that environment needs, rather than using a single full-access key everywhere.
  • Store the SendGrid API key in Retool Configuration Variables marked as 'secret', not directly in the resource configuration, so it can be rotated without touching resource settings.
  • Add confirmation dialogs to all Send Email buttons — especially for bulk operations — to prevent accidental email sends to real customers.
  • Set all email-sending queries to Manual trigger mode to ensure they only fire on explicit user action, not on page load or automatic reruns.
  • Monitor your bounces and spam reports weekly using a Retool Workflow that checks suppression list counts and alerts your team via Slack when they exceed acceptable thresholds.
  • For bulk contact imports, note that SendGrid's Add Contacts API is asynchronous — use the returned job ID to check import status and always inform Retool users that there may be a delay before contacts appear.
  • Test all email functionality against a dedicated test email address or email testing service (like Mailtrap) before routing through real customer email addresses.

Alternatives

Frequently asked questions

Can I send emails to multiple recipients at once from a Retool app using SendGrid?

Yes. In the Send Email query's To field, you can pass an array of email address objects rather than a single address. Use a JavaScript expression to map selected table rows to the required format. Keep in mind that SendGrid's transactional email API has different rate limits than their bulk/marketing email API, and large bulk sends should go through the Marketing Campaigns endpoint rather than individual transactional sends.

Can Retool show me email delivery status (opened, clicked, bounced) for emails I sent?

Yes, via SendGrid's Event Webhook and Stats APIs. The Get Stats operation in the SendGrid query editor returns aggregate delivery, open, and click statistics for a given date range. For per-email event tracking (individual open events), you would need to store events via SendGrid's Event Webhook posted to your own database, then query that database from Retool — SendGrid's API does not provide a direct per-email event history endpoint for all events.

Does the Retool SendGrid integration support SendGrid's email validation API for checking if addresses are valid before sending?

Retool's native SendGrid connector focuses on mail send, suppressions, and contact management operations. For SendGrid's Email Validation API (a separate paid add-on that checks email address validity and deliverability score), you would configure a separate REST API Resource in Retool pointing to the validation API endpoint at api.sendgrid.com/v3/validations/email, with your API key in the Authorization header.

How do I handle SendGrid's asynchronous contact import — how does Retool know when the import completed?

SendGrid's Add Contacts API returns an import job ID and processes the import asynchronously, typically completing within a few minutes for small lists. In Retool, you can create a polling mechanism: store the job ID in a Retool variable, then use a timer event or manual refresh button to call the Get Import Status endpoint with that ID. When the status shows 'completed', refresh the contacts table. For most operational use cases, simply showing a 'contacts queued' notification is sufficient.

Can I use Retool to manage SendGrid email templates (create or edit them)?

Retool's native SendGrid connector supports sending emails using existing templates and reading template lists, but creating or editing template content requires either the SendGrid Dashboard UI or SendGrid's Templates API via a custom REST API query in Retool. For most teams, managing template design in SendGrid's built-in editor and using Retool only for operational email sending and monitoring is the recommended workflow.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire Retool integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.