How to send one or more certificates attached as PDFs using mail merge.
Each person may have completed a number of courses, so instead of sending them multiple emails with a single attachment, one email is sent with multiple attachments.
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 send an email with the generated PDFs as attachments. Both the email and the attached PDFs are personalized with information from the corresponding rows.
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 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.