A mail merge that groups rows by customer.

You’re running a mail merge — but each customer has multiple rows of line-item data. pdfMachine merge groups them automatically, so each recipient gets one email with one consolidated PDF instead of one email per row.

Group rows by recipient. pdfMachine merge spots consecutive rows that share an email address and treats them as one group — one customer, one email, one attachment, however many rows behind it.
Line items appear in the PDF. Mark a repeating section in your template. Each row in the group fills one line item; the merged PDF comes out with all the lines in place.
Last row sets the email details. Recipient, subject, body, attachment name — all come from the last row of each group. Put your customer-level fields there, line-item fields throughout.

Many rows in. One email attachment out.

Requires a pdfMachine merge license.