Email a templated message to a list of people (aka Mail Merge)

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:

  1. 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.
  2. 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.
  3. 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 :handshake:

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