Rows to emails method


This decides how the rows in the data source map to the emails sent.

Each row creates an email

This is the default mode. Each row in the data source file will generate an email with attachment(s) based on a single row's data.

Each row creates an attachment

Each row in the data source file will generate an attachment. Emails are grouped together on consecutive email address.

e.g. You might have a data source file where the first 3 rows all have the same email address, but other fields are different. In this case, 3 attachments will be generated and sent in a single email.

One or more rows generates an attachment

Consecutive rows in the data source file that have the same email address can be "bundled" together and only one email is sent per bundle.

This is often the case when producing data from database queries.

An example use is sending out invoices to clients. Lets say you have a data source file containing line items such as:

email customer invoice_id invoice_date item unit_cost quantity amt_due
wayne@acme.com Acme Corp 223 23-Jan-11 blue widget $23 4 $391
wayne@acme.com Acme Corp 223 23-Jan-11 red widget $21 2 $391
wayne@acme.com Acme Corp 223 23-Jan-11 green watzit $13 1 $391
wayne@acme.com Acme Corp 223 23-Jan-11 pink jigger $19 1 $391
wayne@acme.com Acme Corp 223 23-Jan-11 black thingy $25 9 $391
bugs@somefirm.com Big Jim's Shop 224 23-Jan-11 black thingy $25 1 $250
bugs@somefirm.com Big Jim's Shop 224 23-Jan-11 pink  thingy $25 2 $250
bugs@somefirm.com Big Jim's Shop 224 23-Jan-11 red  thingy $25 3 $250
bugs@somefirm.com Big Jim's Shop 224 23-Jan-11 blue  thingy $25 4 $250
smith@smiths.com Smiths Inc. 225 23-Jan-11 blue  thingy $25 4 $100

With this method, only 3 emails will be sent.
When it comes to substituting merge tags with data, tags must have two underscore (_) characters and a number appended to them to identify which row to use in the group of rows with the same email.
e.g.
     {{item}} - the last item in the bundle
     {{item__1}} - the first item in the bundle
     {{item__2}} - the second item in the bundle
     ...
     {{item__N}} - the Nth item in the bundle


Note: If there are a variable number of rows per email address in the data source file, and you want to create tables with a variable numbers of rows, we recommend using HTML templates with Liquid templating language and/or Javascript.

If you need help or more information on this feature please contact