How to create an Excel or CSV data source for a mail merge operation

In a mail merge operation a data source contains all the information that is pulled in during a mail merge to personalize the individual emails and documents. The data sources can be created manually or produced by reporting from an existing system, database or application. pdfMachine merge accepts data sources in Excel or CSV format. The following instructions show how to format a data source for a mail merge operation.

Step 1. Make a list of fields you need personalized.

These will be known as merge fields. The merge fields will be the column names in the data source. They must be placed in the first row of the data source. One of the merge fields must be the email address that the email will be sent to.

Step 2. Determine if the rows of the data source will result in one PDF attachment sent in each email, multiple PDF attachments sent in each email, or multiple line items bundled together in a single PDF attachment.

(a) One personalized PDF is sent per email

Configure pdfMachine merge so that "Each row creates an email". Build the rows in the data source so that all information pertaining to the email and the PDF attachment is in a single row. Each row will become a single email with a single PDF attachment.


(b) Multiple personalized PDFs are sent in each email

Configure pdfMachine merge so that "Each row creates an attachment". Group the rows so that all information pertaining to the PDF attachments in a single email are in multiple consecutive rows with the same email address. Each row will have the same information, except for the information that needs to be different in each attachment. Each row will become a PDF attachment in a single email.


(c) Rows form line items within a PDF

Configure pdfMachine merge so that "One or more rows generates an email" Group the rows so that all information pertaining to the PDF attachment is in multiple consecutive rows. Each row will have the same information, except for the information that differs per line item. Each row will become a different line item in the email body and / or PDF attachment and be sent in a single email.

Step 3. Create or download a CSV or Excel file with the merge fields as the column headings and the rows grouped as you selected in step 2.

Make sure there are no blank rows until the end of the data source.

Step 4. Your data source is now ready to use in a mail merge operation.