If you’re a heavy Notion user, you probably have at least one database which is a list of people. They could be customers, clients, employees, or even party guests. And I bet at some point, you’re going to need to email everyone in that database.
Instead of sending a manual email to each person, you can set up a Mail Merge to automatically send a personalized email to each person.
Here’s how to do that in Relay.app!
1. Set Up Your Database
First, ensure that your database of people has all of the information you’ll need, including the email address and first name of each person.
![](https://cdn.sanity.io/images/1h9u8aig/production/731a9db8bfb10b3438bd71d52b8ea865aab101f1-1558x768.png?w=3840&q=75&fit=max&auto=format&dpr=2)
2. Set Up Your Batch Trigger
In Relay.app, you’ll set up a Batch Trigger by going into the Trigger menu and selecting “Start runs in batches”. You can either do this on-demand by clicking “Manually” or you can set up a “Recurring schedule” (for example, if you want to email a list of people every week). For this example, we’ll do it on-demand.
![](https://cdn.sanity.io/images/1h9u8aig/production/3c673eb9121a22985a22d04e54c4793e1db3fada-1478x1226.png?w=3840&q=75&fit=max&auto=format&dpr=2)
3. Select Your Database
To configure the trigger, select Notion as your app and choose the right database.
![](https://cdn.sanity.io/images/1h9u8aig/production/12f47a7a5f341894282b7874186c765b1ea04f56-2184x1194.png?w=3840&q=75&fit=max&auto=format&dpr=2)
4. Set Up Your Send Email Step
Next, you’ll add the automation to send the email, using Gmail in this example. In the “To” field, you can select the email address of the current Notion page. In the body of the email, you can reference the first name and any other information that’s relevant.
![](https://cdn.sanity.io/images/1h9u8aig/production/d3b74c11b209603b309525a752ee3ab7f0645354-2200x1240.png?w=3840&q=75&fit=max&auto=format&dpr=2)
5. Test the Automation with a Single Email
Before running the mail merge for every entry in your database, you can test it with a single item.
![](https://cdn.sanity.io/images/1h9u8aig/production/146c943169672dc1f8a3c1577f1a18de561c701b-1230x928.png?w=3840&q=75&fit=max&auto=format&dpr=2)
Once you’re happy with the test, you can run the Mail Merge for every item in the database. When it’s done, you’ll see all of the completed runs to confirm that everything happen as you intended.
And that’s it! The whole process should only take a few minutes to set up and it can save you hours of sending emails one by one.