Skip to main content

Send custom transactional emails

Learn how to use Retool Events to send transactional emails from your email domain.

Available on:Enterprise plan

Using Retool Events, you can override the default emails Retool sends following certain events, and override them with your organization's custom branding and content. This guide outlines the steps required to configure custom emails for transactional and onboarding events.

Requirements

To send emails from a custom domain, you should also ensure your organization has configured a custom domain.

This guide uses SendGrid as an example, but you can use your email provider of choice. To use SendGrid, configure it as a resource in Retool. In SendGrid, you also need to retrieve the template IDs you want to use in your emails.

You must also be an admin of your organization to configure Retool Events and have permissions to modify the relevant workflows.

1. Disable Retool-branded emails

By default, Retool sends emails from email.retool.com with Retool branding. To disable sending these emails and override them with emails sent by your workflow:

  1. Go to Settings > Branding.
  2. In the Preview section, select the dropdown on the upper right and choose the email type.
  3. Click Manage on the email preview.
  4. In the modal, choose a workflow to connect, and select the checkbox to disable the Retool-managed email.
  5. Save your changes.

2. Customize emails

The default templates for workflows involving emails include a SendGrid resource block, which sends a POST request to /mail/send. To use SendGrid's dynamic templates, set a template_id and dynamic_template_data. You can replace this block with any email provider of your choice, as long as you've connected it as a resource in Retool.

Send transactional emails

The Reset Password and User Invite events can be used to send custom transactional emails.

When you pass data to your template, ensure you include the resetPasswordLink or other link parameters, so users can access it in emails. For example, assuming your SendGrid template includes content with the {{orgName}} and {{resetPasswordLink}} template tags, you might set the following parameters in your workflow block:

{
orgName: "Event Triggers demo",
resetPasswordLink: {{ startTrigger.data.resetPasswordLink}}
}

In the to field, use {{ [{ email: startTrigger.data.requestingUserEmail}] }} or {{ [{ email: startTrigger.data.invitedUserEmail}] }}.

Send onboarding emails

The User Created event can be used to send custom welcome emails. The default template for these workflows contains a template including a SendGrid block, similar to transactional emails.

For onboarding emails, you may want to use data about your users to suggest different onboarding materials based on user attributes. For example, given you have a users table, you can first add a resource block to retrieve metadata about your user. This also gives you data to personalize the email in further blocks.

select * from users where email = {{ startTrigger.data.userEmail }};

Your next block can be a branch block to read from getUserFromDB.data to check the user's status or team. You can then connect to separate SendGrid resource blocks to send different templates based on these attributes. Each /mail/send block can use a different template ID and contain links to team-specific Retool apps, documentation, checklists, or other useful resources. In this workflow, you can also attach additional metadata to your user object in this workflow, send notifications outside of email, and customize it to suit your organization's needs.