> ## Documentation Index
> Fetch the complete documentation index at: https://notikaai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Add Emails to Your Replit App (The Easy Way)

> Add welcome emails, notifications, and email blasts to your Replit app. No code changes, no API keys. Just connect your database and describe what you want.

## How do I add email to my Replit app?

Your [Replit](https://replit.com) app is live and users are signing up. Now they need a welcome email, a password reset, maybe an order confirmation. The catch: Replit's newer database isn't accessible externally, so the setup depends on which database your project uses.

This guide walks you through it. If you have a legacy Replit database (Neon-hosted, pre-December 2025), you can connect directly. If you're on the newer database or an external provider like Supabase, we'll cover that too. Once connected, Dreamlit securely reacts to database changes and handles notifications end-to-end:

* Member joins → welcome email
* Form submitted → confirmation sent
* Milestone reached → celebration email

Describe the email you want, and the AI builds the workflow.

<p align="center">
  <img src="https://mintcdn.com/notikaai/gtrrDIJuwtzRoBsV/images/replit-dreamlit.png?fit=max&auto=format&n=gtrrDIJuwtzRoBsV&q=85&s=6fa5ff03f121ca76988fe7b9677e6942" alt="Replit + Dreamlit" style={{borderRadius: '12px', maxHeight: '300px'}} width="762" height="501" data-path="images/replit-dreamlit.png" />
</p>

## Who is this guide for?

* **Replit developers** shipping apps that need transactional email
* **Builders on Replit + Supabase** who want professional notifications in minutes
* **Anyone with a legacy Replit database** who wants to use it before migrating

## Why use Dreamlit instead of building email in Replit?

You could ask Replit's AI to wire up an email provider. It'll generate the integration code. But then:

1. How do you preview that email with real user data before it goes out?
2. How do you track who opened it? Who clicked?
3. What happens when emails bounce?
4. Are you setting up DKIM and SPF records for deliverability?
5. What about retry logic when the provider has an outage?
6. What about scheduled emails? Recurring digests? Drip sequences?
7. After you've built a few workflows, how do you see how they're all performing in one place?
8. How do you iterate on email copy without redeploying?

Or just use Dreamlit and skip all of that. We handle it end-to-end.

## What do I need before starting?

* A Replit app with **one of the following**:
  * An external database like **Supabase** or **Neon** that you've explicitly connected (Replit doesn't set these up by default; you would have prompted Replit to use one)
  * A **legacy Replit database** created before December 4, 2025 ([see below](#using-replits-built-in-database) for details)
* 5 minutes

***

## Does my Replit project have a compatible database?

Dreamlit needs direct database access to set up triggers and react to changes. Here's how to check if your project is set up correctly.

### Using Supabase or another external database

If you've explicitly prompted Replit to connect your app to **Supabase**, **Neon**, **Railway**, or another external PostgreSQL database, you're good to go. Skip ahead to [Connect Dreamlit to your database](#connect-dreamlit-to-your-database).

<Note>
  Replit doesn't use external databases by default. If you didn't specifically ask for Supabase or another provider when building your app, you're likely using Replit's built-in database.
</Note>

### Using Replit's built-in database

Replit offers a built-in PostgreSQL database, but its accessibility depends on when you created it.

<Tabs>
  <Tab title="Created before Dec 4, 2025">
    **You can use Dreamlit.**

    Projects created before December 4, 2025 use a [legacy Neon-hosted database](https://docs.replit.com/cloud-services/storage-and-databases/sql-database#legacy-development-database) with an accessible connection string.

    To check, look at your `DATABASE_URL` environment variable:

    * If it contains `neon.tech/neondb`, you have the legacy database and can connect to Dreamlit
    * If it contains `helium/heliumdb`, you have the newer restricted database (see next tab)

    <Warning>
      **Keep your connection string private.** The legacy `DATABASE_URL` grants full database access. Never share it publicly or commit it to version control.
    </Warning>
  </Tab>

  <Tab title="Created after Dec 4, 2025">
    **You'll need to add an external database.**

    Replit's newer database is only accessible from within your app. It's not exposed externally, which means Dreamlit can't connect to react to changes.

    Replit exposes tables only through their APIs, and Dreamlit requires deeper database integration to set up triggers and react to changes in real time. We're hopeful Replit will make it easier to access the underlying database in the future, but they haven't made any commitments yet.

    **Your options:**

    1. **Add Supabase to your Replit app** (recommended): Prompt Replit to use Supabase instead of the built-in database, or set it up manually. See the [appendix](#appendix-adding-supabase-to-your-replit-app) for step-by-step instructions.
    2. **Add another Postgres provider**: Prompt Replit to use Neon, Railway, Render, or any other Postgres database.
  </Tab>
</Tabs>

***

## How do I connect Dreamlit to my database?

<Tabs>
  <Tab title="Legacy Replit Database (Neon)">
    If your Replit project uses the legacy Neon-hosted database (created before December 4, 2025):

    <Steps>
      <Step title="Create a Dreamlit account">
        Go to [app.dreamlit.ai](https://app.dreamlit.ai) and sign up.
      </Step>

      <Step title="Get your connection string">
        In your Replit project, go to **Secrets** and copy your `DATABASE_URL`. It should contain `neon.tech/neondb`.
      </Step>

      <Step title="Connect in Dreamlit">
        Click **Connect Postgres** and paste your connection string. Follow the guided setup to grant Dreamlit the minimal permissions it needs.
      </Step>
    </Steps>

    For detailed setup instructions, see [commands to set up your database user](/docs/configuration/data-sources/postgres#commands-to-run-to-setup-your-dreamlit_app-database-user).
  </Tab>

  <Tab title="Supabase">
    If your Replit app uses Supabase, connecting is two clicks:

    <Steps>
      <Step title="Create a Dreamlit account">
        Go to [app.dreamlit.ai](https://app.dreamlit.ai) and sign up.
      </Step>

      <Step title="Connect via OAuth">
        Click **Connect Supabase** and authorize the connection. Dreamlit securely connects to your Supabase project.

        <Frame>
          <img src="https://mintcdn.com/notikaai/adckcWobFeOatSLI/images/supabaseconnect.gif?s=fae094684d1c16f9d6ba024157359ea0" alt="Connecting Supabase via OAuth" width="1408" height="1080" data-path="images/supabaseconnect.gif" />
        </Frame>
      </Step>
    </Steps>

    **That's it. 2 clicks and you're connected.**

    <Tip>
      **Need auth emails?** (password reset, magic links, email verification) Check out our [Supabase Auth Emails guide](/docs/guides/supabase-auth-emails) for one-click setup.
    </Tip>
  </Tab>

  <Tab title="Other Postgres">
    <Steps>
      <Step title="Create a Dreamlit account">
        Go to [app.dreamlit.ai](https://app.dreamlit.ai) and sign up.
      </Step>

      <Step title="Get your connection string">
        Copy your Postgres connection string from your database provider (Neon, Railway, Render, etc.).
      </Step>

      <Step title="Connect in Dreamlit">
        Click **Connect Postgres** and paste your connection string. Follow the guided setup to grant Dreamlit the minimal permissions it needs.
      </Step>
    </Steps>

    For detailed setup instructions, see [commands to set up your database user](/docs/configuration/data-sources/postgres#commands-to-run-to-setup-your-dreamlit_app-database-user).
  </Tab>
</Tabs>

***

## How do I create my first email workflow?

Here's an example: setting up a welcome email that sends when someone signs up.

### Step 1: Create the workflow in Dreamlit

Click **Create Workflow** and describe what you want:

> "Send a welcome email when a new user signs up"

The AI generates everything: the database trigger, email template, and copy.

<Frame caption="The AI generates your workflow automatically">
  <img src="https://mintcdn.com/notikaai/ND5vtH9yB3HGk0VQ/images/new-workflow.gif?s=cf7aaa6638f6349bb3e9cf79f7512383" alt="AI generating a welcome email workflow" width="1784" height="720" data-path="images/new-workflow.gif" />
</Frame>

### Step 2: Update your Replit app (if needed)

Here's the key insight: **Dreamlit securely connects to your database and reacts to changes, not your code.** When a new row appears in your `users` table, Dreamlit sends the email automatically.

If your Replit app already creates user records on signup, you're done. No code changes needed.

If you need to add a table for Dreamlit to use as a trigger, prompt your AI assistant:

> "When a user signs up, add a row to the `user_signups` table with their email and name"

Or for something like order confirmations:

> "When a user completes checkout, insert a row into the `orders` table with the order details"

### Step 3: Preview and publish

Preview your email with real data from your database, then click **Publish**.

***

## How does Replit work with Dreamlit?

Dreamlit triggers emails based on database changes. When building in Replit, focus on getting data into your database. Dreamlit handles the rest.

**Good prompts:**

| You want...           | Prompt with...                                                     |
| --------------------- | ------------------------------------------------------------------ |
| Welcome emails        | "Store new signups in a `user_signups` table"                      |
| Order confirmations   | "Insert order details into `orders` when checkout completes"       |
| Comment notifications | "Save comments to a `comments` table with the post\_id and author" |
| Activity alerts       | "Log user actions to an `activity` table"                          |

**You don't need to prompt about emails at all.** Just make sure the data lands in your database, and Dreamlit takes it from there.

***

## What other workflows can I build?

Any workflow that triggers on a database change. Check out our [use cases](/docs/getting-started/use-cases) for example prompts across welcome emails, order confirmations, reminders, internal alerts, and more.

***

## How do I send from my own domain?

By default, emails send from Dreamlit's domain. To send from your own domain (like `hello@yourapp.com`), set up a custom email domain in minutes.

<Steps>
  <Step title="Add your domain">
    Go to **Settings → Email Domains** and click **Add domain**. Enter your domain (we recommend a subdomain like `mail.yourapp.com`).
  </Step>

  <Step title="Verify automatically">
    Dreamlit can automatically configure your DNS records for you. Just click **Verify with your DNS provider**, sign in to your provider, and authorize the changes.

    <Frame caption="Automatic DNS setup, no manual records needed">
      <img src="https://mintcdn.com/notikaai/ND5vtH9yB3HGk0VQ/images/auto-dns.gif?s=ce1cca7fadcd17e41cb37a8fdce2753d" alt="Automated DNS verification flow" width="1024" height="720" data-path="images/auto-dns.gif" />
    </Frame>

    <Tip>
      If your DNS provider isn't supported for automatic setup, you can add the records manually. Dreamlit shows you exactly what to add.
    </Tip>
  </Step>

  <Step title="Start sending">
    Once verified, select your domain when creating email workflows. Your emails will now come from your own brand.
  </Step>
</Steps>

This improves deliverability and looks more professional to your users. [Full domain setup guide →](/docs/configuration/email/custom-domain)

***

## FAQ

### Why can't Dreamlit connect to my Replit database?

Replit's newer database (created after December 4, 2025) is [only accessible from within your app](https://docs.replit.com/cloud-services/storage-and-databases/sql-database#legacy-development-database) and isn't exposed externally. Dreamlit needs direct database access to set up triggers and react to changes. You'll need to add an external database like Supabase.

### How do I know if I have the legacy or new Replit database?

Check your `DATABASE_URL` environment variable in Replit Secrets:

* Contains `neon.tech/neondb` → Legacy database (works with Dreamlit)
* Contains `helium/heliumdb` → New database (needs external database)

### Will Replit ever support external database connections?

We hope so. Replit's current approach prioritizes security by keeping the database internal. We're hopeful they'll add an option for external access in the future, but they haven't announced any plans.

### Why aren't my emails sending?

A few things to check:

1. **Is your workflow published?** Saved workflows don't run until you click Publish.
2. **Is the trigger table correct?** Make sure it matches where your Replit app actually writes data.
3. **Is data being written?** Check your database to confirm rows are being created.
4. **Try the preview.** Use the preview to test with sample data and verify the workflow runs.

### Do I need to change my Replit app code?

If you're adding Supabase, yes, you'll need to update your database calls. If you're already using Supabase or have a legacy Replit database, usually no changes are needed. Dreamlit reacts to database changes, so if your app already writes the data you need, you're all set.

### Will my emails keep working after I redeploy?

Yes. Dreamlit connects to your database, not your Replit deployment. Deploy as often as you like. Your email workflows keep running.

### Can I send Slack notifications too?

Yes. Dreamlit supports Slack alongside email. Just describe what you want: "Notify our team on Slack when a new order comes in." [Learn more about Slack →](/docs/configuration/slack)

### How do I test without emailing real users?

Use the preview feature to send test emails to yourself with real data from your database. Your workflow won't email actual users until you publish it.

### What if I'm already using Resend, SendGrid, or another email provider?

Dreamlit works alongside traditional email providers. Since Dreamlit takes a fundamentally different approach (database-driven, AI-generated workflows), you don't need to migrate off your existing setup. Try Dreamlit for your next workflow and keep using your current provider for everything else.

***

## Next steps

<CardGroup cols={2}>
  <Card title="Supabase Auth emails" icon="shield-keyhole" href="/docs/guides/supabase-auth-emails">
    Set up password reset, magic links, and more
  </Card>

  <Card title="Email domain setup" icon="at" href="/docs/configuration/email/custom-domain">
    Send from your own domain
  </Card>

  <Card title="Use cases" icon="lightbulb" href="/docs/getting-started/use-cases">
    More workflow examples
  </Card>

  <Card title="Get support" icon="headset" href="/docs/resources/getting-support">
    We're here to help
  </Card>
</CardGroup>

## References

* [Replit SQL database docs](https://docs.replit.com/cloud-services/storage-and-databases/sql-database)
* [Replit legacy database migration](https://docs.replit.com/cloud-services/storage-and-databases/sql-database#legacy-development-database)
* [Dreamlit Supabase integration](/docs/configuration/data-sources/supabase)
* [Dreamlit Postgres setup guide](/docs/configuration/data-sources/postgres)
* [Supabase Auth SMTP docs](https://supabase.com/docs/guides/auth/auth-smtp)
* [Dreamlit use cases](/docs/getting-started/use-cases)

***

Last validated: 2026-04-12

***

## Appendix: Adding Supabase to your Replit app

If you need to add an external database, Supabase is the easiest option. Here's how:

<Steps>
  <Step title="Create a Supabase project">
    Go to [supabase.com](https://supabase.com) and create a free project. Note your project URL and API keys.
  </Step>

  <Step title="Add environment variables to Replit">
    In your Replit project, go to **Secrets** (the lock icon) and add:

    * `SUPABASE_URL`: Your Supabase project URL
    * `SUPABASE_ANON_KEY`: Your Supabase anon/public key
    * `DATABASE_URL`: Your Supabase connection string (found in Project Settings → Database)
  </Step>

  <Step title="Update your app to use Supabase">
    Replace your database calls with Supabase. If you're using AI to build your app, prompt it:

    > "Replace the Replit database with Supabase. Use the SUPABASE\_URL and SUPABASE\_ANON\_KEY environment variables."

    Or if you prefer direct Postgres:

    > "Connect to Postgres using the DATABASE\_URL environment variable instead of the Replit database."
  </Step>
</Steps>

Once your app uses Supabase, return to [Connect Dreamlit to your database](#connect-dreamlit-to-your-database) to finish setup.
