If you want to send templated emails to a list of people, here’s an example doc.
It’s set up with 3 tables / sections:
- People table: The name column will be used in the email template, the email column is used for sending to, and the send email button column connects through the Gmail Pack to send out from the Coda doc.
- Content table: Because we can’t yet use a Section for mail merge, you’ll need to put the standard / boilerplate content of the email in a table. This is a one cell table (one column, one row) to mimic a section.
- Email Template table: The is the overarching structure of the email that you’ll send. The {1} and {2} are placeholder variables. We’ll eventually pass in the First Name column and Content table’s Body column variables into it.
The Button to send the email through the Gmail Pack is set up like this:
The Content section of the email button builder uses the Format formula:
- Structure: Format (basic structure with placeholder variables, variable 1, variable 2)
- In this example: Format([Email Template].Body, thisRow.[First Name], Content.Body)
7 Likes
I simply can’t get this to work. I get format() to call the correct table cell, but it will not replace the bracketed numbers in that cell, even when I manually enter strings. Assume Email is a 1-column, 1-row table with a Column called “Structure”. In that cell, it reads “Hi there. {1} {2} {3}”. So when I call format(Email.Structure,“This”,“Is”,“a Thing”), I should get “Hi there. This Is a Thing”. But I get “Hi there. {1} {2} {3}” when the email arrives. I’m not sure what I’m doing wrong.
Dear @Damon_Jordan, welcome to the community 
Would you mind to share a dummy copy of your doc, this will make it easier to identify the error?
Hi @Jean_Pierre_Traets. Well, I made a copy of it, published it, and all of a sudden, it magically worked. I don’t know what happened, but it seems OK now. Thanks for reaching out.
2 Likes
One quick question, is there a way to include attachments in the email using the Gmail Pack? I can see how the template and placeholders work for text content, but if I wanted to include a PDF or image, would that require a separate workaround?
Coda’s approach to mail merge is pretty clever, especially with the way it uses tables for dynamic content. If anyone’s looking to automate email campaigns or personalized messaging, this structure is a great starting point. Has anyone tried integrating it with other packs or tools for more advanced workflows?
IIRC, Google’s API doesn’t allow them to do attachments. You can upload the file to Google Drive and attach the link.
I use the outlook pack, and that allows me to use attachments.