How to mail merge and send one email with a single PDF attachment that is made up of appended pages using different data from the rows in the data source

Use the "Each row appends to an attachment" method of pdfMachine merge to achieve this.

Step 1. Create the template (layout).

Using Word, PowerPoint, HTML or Excel create a template with the layout, formatting, text, and graphics that is common to all of the page(S) to be appended to the attachment.

Insert 'merge fields' as placeholders in the template where the personalized information for each document will be inserted.

2. Create a data source where "Pages are appended to a PDF to be sent in each email". See how.

Create or download an Excel or CSV file that has the data that will change for each page(s).

Each column is a merge field. Each row holds the information for a single attachment. Data from consecutive rows with the same email address will be merged with the layout(s) and converted to PDF. The PDFs will then be appended together to form a single attachment in a single email.

3. Create a profile in the pdfMachine merge software to link the template and the data source

Select "Each row appends to an attachment" so that the page(s) are appended together to form an attachment.

4. Define the body of the email

Create a body with the layout, formatting and text that will be common to all emails. Insert merge fields as placeholders for the information that will be personal to each email.

5. Choose which email method (Extended MAPI, Outlook or SMTP) will be used to send the attachments

6. Test the result

7. Send the documents

Watch the Video

Video : How to mail merge one PDF with multiple page(s) formed from the same layout

An email is sent with a certificate attached for each course completed.

Video tutorial demonstrating how to use pdfMachine merge. A mail merge sends batches of emails with personalized PDF attachments. Each email has one attachment which is built by appending PDFs built from the rows in the data source. Emails can be sent using Extended MAPI, Outlook or SMTP.

Example : Each row appends to a PDF attachment

This example is "Test Profile - Each row appends to an attachment".

pdfMachine merge uses a PowerPoint template and a CSV data source. pdfMachine merge will iterate through the rows of the data source generating a personalized PDF attachment for each row, the merge fields are replaced with the appropriate data from each row. On reaching a change in email address, pdfMachine merge will conmbine the PDFs into a single PDF and then send an email with the combined PDF as an attachment. Both the email and the attached PDF are personalized with information from the corresponding rows.

Steps to create a merge profile

Template

Create the layout for your dynamically generated PDF attachment.

Step 1 : Create the template

Data Source

Create the data to personalise the emails and PDFs.


Step 2 : Create the data source

Merge Profile

Configure pdfMachine merge to create and send the emails, use "Each row appends to an attachment".

Step 3 : Create the profile

Example : Each row appends to a PDF attachment

pdfMachine merge installs with ready made profiles to get you started.
This example is "Test Profile - Each row appends to an attachment"

Create a template (this one was created in PowerPoint) that has merge fields surrounded by {{ }}. The names of the merge fields must exactly correspond to the column names in the data source. The merge fields can be formatted using the Liquid Templating Language.

Example : Each row creates a PDF attachment

pdfMachine merge installs with ready made profiles to get you started.
This example is "Test Profile - Each row creates an attachment"

Create a data source (this one is a CSV file) that has merge fields as column headings. Each row must have an email address. Create consecutive rows with the same email address to have that data bundled as attachments to one email.

In this example four emails will be sent.

  • The first will have 4 attachments
  • The second will have 2 attachments
  • The third will have 1 attachment
  • The fourth will have four attachments

Example : Each row creates a PDF attachment

pdfMachine merge installs with ready made profiles to get you started.
This example is "Test Profile - Each row creates an attachment"

Create a profile within pdfMachine merge. Merge fields can be used - surrounded by {{ }}. Attach your data source and template. Set the Rows To emails method to "Each row creates an atachment".

. . .