Search code examples
htmlzapierairtable

Using Zapier Digests to send Airtable Data in a Table Format Via Gmail


I'm trying to use Zapier to send digests via Gmail using (1) a Digest zap to aggregate the data & (2) a Schedule zap to trigger sending the digest. I want the data pulled in my Zap to output in the format of a table.

Things I tried -

1) Attempt 1: include html code for the entire email & table (headers and rows) in the Digest zap and use the Schedule email to just send the digest Problem: it adds all of the formatting to EVERY data point it collects (so if I have table headers or anything of the sort, I get a new table header row for each bit of data it gathers).

2) Attempt 2: Create two html tables - one in the Digest zap with just the data rows (so no table headers, other email text, etc) and one in the Schedule zap with the email text and row headers. Problem: the column widths between the Digest zap row html and the Schedule zap email html don't align (even with column width built into the html).

3) Attempt 3 (code below): Only include html coding for rows in the Digest zap and then wrap that in table html in the Schedule zap Problem: the output is a single, very long row

<tr>
    <td width="150">{{65510999__fields__Title (W Deals)}}</td>
    <td width="150">{{65510999__fields__Option Type (W)}}</td>
    <td width="150">{{65510999__fields__Option Status (W)}}</td>
    <td width="150">TBD</td>
    <td width="150">{{65510999__fields__Option Link (W)}}</td>
    <td width="150">{{65510999__fields__Deal Link (W)}}</td>
<tr>
<!DOCTYPE html>
<html>
<head>
<style>
table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</head>
<body>

<h2>OA Options - TBD Deadlines</h2>

<table>
  <tr>
      <th width="200">Title</th>
      <th width="200">Option Type</th>
      <th width="200">Option Status</th>
      <th width="200">Deadline</th>
      <th width="200">Option Link</th>
      <th width="200">Deal Link</th></tr>

 [DIGEST]


</table>
</body>
</html>


Solution

  • As discussed above, your <tr> tags are missing their matching closing tag. Try this instead:

    digest:

    <tr>
        <td width="150">{{65510999__fields__Title (W Deals)}}</td>
        <td width="150">{{65510999__fields__Option Type (W)}}</td>
        <td width="150">{{65510999__fields__Option Status (W)}}</td>
        <td width="150">TBD</td>
        <td width="150">{{65510999__fields__Option Link (W)}}</td>
        <td width="150">{{65510999__fields__Deal Link (W)}}</td>
    </tr>