---
title: "Send email from Shopify Flow with your own SMTP server"
description: "Step-by-step guide with video: connect Gmail, SendGrid, Mailgun, Amazon SES or any custom SMTP server to Shopify Flow and send a branded VIP welcome email."
canonical: "https://crm-tool.k8s-gcp-dev.eu.codecreationlabs.cloud/h/flow-transactional-email/send-email-with-smtp"
---

# Send email from Shopify Flow with a custom SMTP server

## Overview

Workflow Transactional Email lets you send transactional email from Shopify Flow through your own SMTP server. In this example a customer receives a `VIP` tag, Shopify Flow runs, and the workflow sends a branded email using your saved SMTP server and email layout.

This setup has three parts:

1. Create an SMTP connection under **Email Senders**
2. Design the email under **Email Layouts**
3. Use the **Send Transactional Email** action in **Shopify Flow** and pass customer data into the layout

Any provider that speaks SMTP works, including Gmail, SendGrid, Mailgun, Amazon SES and your own mail server.

## Video guide

The full setup - SMTP server, email layout, and the Shopify Flow workflow. **The video has no sound**, so adjust the playback speed to suit you.

https://www.youtube.com/watch?v=hqdksDmTuGI

## Before you begin

- Install **Workflow Transactional Email** in your Shopify store.
- Have the host, port, username and password from your SMTP provider to hand.
- Decide which sender address the VIP emails should come from.

## Scenario: a VIP welcome email

The workflow does this:

1. A customer is tagged `VIP`
2. Shopify Flow starts the workflow
3. The workflow runs the **Send Transactional Email** action
4. The action uses your saved SMTP server
5. The action sends your saved email layout with the customer's details filled in

## Step 1: Configure your SMTP server

In the app, open **Email Senders** and go to the SMTP section. This is where you store the mail server that will send your transactional email.

![The Email Senders page in Workflow Transactional Email](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/1c20be9449c40377.png)

Enter the SMTP host, port, username and password from your provider, then press **Test Connection**.

![Entering SMTP host, port, username and password](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/b6dcb2ae5c3790e4.png)

> [!NOTE]
> The connection test is required before you can save. This is deliberate - it catches a wrong port or a bad password now, rather than silently dropping a customer's email later. Encryption is derived from the port automatically: port 465 uses SSL, port 587 uses STARTTLS.

If the credentials are good, you will see a success message.

![A successful SMTP connection test](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/bfaac34cf8a4fdf6.png)

Choose the address the message should come from. Set a display name too, so recipients see your store name rather than a raw address.

![Setting the from address and display name](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/ad41a2e1e90c60cf.png)

Save the configuration so it can be selected later by your Shopify Flow action.

![Saving the SMTP configuration](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/5b4a706d92779459.png)

> [!TIP]
> If you send different kinds of email, create a separate SMTP server entry for each brand or sending domain. It keeps VIP, support and operations email cleanly separated, and makes a deliverability problem easier to isolate.

## Step 2: Design the email

Go to **Email Layouts**. This is where you create the email content that Shopify Flow will send.

![The Email Layouts page](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/dbdb94fcca8e7a1b.png)

Create a layout for your VIP scenario, with a subject line and a body. The subject can use variables passed in from Shopify Flow. This example uses `firstName` with Liquid's [`default` filter](https://shopify.dev/docs/api/liquid/filters/default) as a fallback:

```
Hi {{ variables.firstName | default: "Customer" }} Welcome to VIP Club
```

Add blocks to build a design that fits your brand.

![Choosing blocks in the email designer](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/ac56b8f505f6d642.png)

This example uses a heading block, an image block and a text block. The text block references the `firstName` variable, which Shopify Flow will supply.

![A layout built from heading, image and text blocks](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/37dc8bed65e71ddb.png)

Use the **Test Variables** section to feed sample values in and check the design renders the way you expect.

![Testing the layout with sample variables](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/65508e3755c10b28.png)

Save the layout so it can be selected inside the Shopify Flow action.

![Saving the email layout](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/635891374c1400e4.png)

For the full block reference, see [Build an email layout](https://crm-tool.k8s-gcp-dev.eu.codecreationlabs.cloud/h/flow-transactional-email/build-an-email-layout.md).

## Step 3: Build the workflow in Shopify Flow

Open **Shopify Flow** and create a workflow for your VIP process. Use the customer tagging trigger, so the workflow runs when a customer gets the `VIP` tag.

![A Shopify Flow workflow using a customer tag trigger](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/a3e7c6b7fedb5b83.png)

Press **Record events**, then in a new tab add the tag to a customer. Select the trigger on the left and you will see the real trigger data - this makes picking the right variables much easier.

![Recording events to capture real trigger data](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/694169722fda769a.png)

Add the **Send Transactional Email** action. In **To Email(s)**, use the customer's email variable. Then press **Configure email**.

![Adding the Send Transactional Email action](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/bac6df5c677f7b32.png)

In the configuration screen, choose the email layout you created and the SMTP server this email should go through. Press **Save**, then **Exit** to return to the workflow.

![Selecting the email layout and SMTP server](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/13ce1dbeb990137e.png)

Back in the action, pass the data your layout needs in the **Variables (JSON)** field:

```
{
  "firstName": "{{ customer.firstName }}"
}
```

![Passing customer data as JSON variables](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/ae4db3070ecc857f.png)

Turn the workflow on once you have confirmed the trigger, condition, layout and variables are all correct.

![Turning on the workflow](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/d129c9921dc480ce.png)

## How the pieces fit together

When the customer gets the `VIP` tag, Shopify Flow runs the workflow and calls the email action. That action combines:

- your saved server settings from **Email Senders**
- your saved design from **Email Layouts**
- the customer values passed in from the Flow step as JSON variables

Keeping these separate is what makes the layout reusable - you send the same design to every customer without editing HTML each time.

## Test it end to end

1. Apply the `VIP` tag to a test customer
2. Confirm the workflow runs in Shopify Flow
3. Check that the customer receives the email
4. Verify the subject line and the HTML render correctly
5. Make sure the sender name and address match your brand

If the message does not arrive, open **History** in the app to see the execution result and the exact error. See [History and troubleshooting](https://crm-tool.k8s-gcp-dev.eu.codecreationlabs.cloud/h/flow-transactional-email/history-and-troubleshooting.md).

Here is the delivered email, using the SMTP server and design from this guide:

![The delivered VIP welcome email](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/cb9dc1eef6f67030.png)

## Related

- [Send email from Shopify Flow with Microsoft 365](https://crm-tool.k8s-gcp-dev.eu.codecreationlabs.cloud/h/flow-transactional-email/send-email-with-microsoft-365.md) - use a Microsoft 365 mailbox instead of SMTP.
- [Send email from Shopify Flow with Google](https://crm-tool.k8s-gcp-dev.eu.codecreationlabs.cloud/h/flow-transactional-email/send-email-with-google.md) - use a Google mailbox instead of SMTP.
- [Variables and Liquid](https://crm-tool.k8s-gcp-dev.eu.codecreationlabs.cloud/h/flow-transactional-email/variables-and-liquid.md) - the full variable and Liquid reference.
