# Mail-merge for a CRM app

**URL:** <https://community.glideapps.com/t/mail-merge-for-a-crm-app/72382>\
**Category:** Ask for Help\
**Tags:** actions\
**Created:** [April 8, 2024, 9:22am UTC](https://community.glideapps.com/t/mail-merge-for-a-crm-app/72382 "2024-04-08T09:22:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![filister](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/filister/32/49775_2.png) [@filister](https://community.glideapps.com/u/filister)\
**Post date:** [April 8, 2024, 9:22am UTC](https://community.glideapps.com/t/mail-merge-for-a-crm-app/72382/1 "2024-04-08T09:22:41Z")

</div>

Hello Glide Community,

I’m working on integrating a feature into a custom CRM app, specifically using Gmail to send targeted emails to selected contacts, similar to a mail merge function but for chosen accounts.

The goal is to identify contacts tagged as qualified leads, select them, and then use a custom action button to open a form. In this form, I’d enter the email subject and content. Upon hitting “Send”, it would trigger emails to all selected contacts, then clear the selection.

Has anyone implemented a feature like this in Glide? I’ve searched through the documentation and community discussions but haven’t found a solution yet.

Thank you for taking a look!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 8, 2024, 11:14pm UTC](https://community.glideapps.com/t/mail-merge-for-a-crm-app/72382/2 "2024-04-08T23:14:31Z")

</div>

I haven’t done something like this, but I guess you would need to:

- Have specific “keys” that the user can enter into their email and it gets replaced automatically. Let’s say [FirstName], [LastName], etc.

- Create a custom form, allow them to enter the subject and body into two user-specific columns.

- Cast those user-specific columns into the leads table.

- Add a choice for them to choose accounts, ideally writing to another user-specific column.

- Use a split text column on top of the chosen accounts list, and a relation back to the leads table to get all the chosen accounts.

- Good to have: Add a single value column on top of the relation to get the first matched row, and display the subject and body to the user as a “preview”.

- Go to the leads table, add a JSON object column that houses the lead’s email, subject and body templates.

- In the table where you have the custom form, use a lookup on top of the relation for chosen leads, to lookup a JSON array of the JSON object you created above.

- Use a webhook action to push that array to Make, loop through that array and send emails.

---

<div class="post-metadata">

**Author:** ![filister](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/filister/32/49775_2.png) [@filister](https://community.glideapps.com/u/filister)\
**Post date:** [April 9, 2024, 12:29pm UTC](https://community.glideapps.com/t/mail-merge-for-a-crm-app/72382/3 "2024-04-09T12:29:51Z")

</div>

Thank you for the detailed overview. I’ll try it, although I’m afraid it may go beyond my current abilities.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 9, 2024, 12:32pm UTC](https://community.glideapps.com/t/mail-merge-for-a-crm-app/72382/4 "2024-04-09T12:32:29Z")

</div>

Just let us know if you need further help.
