Prev post
PDF-to-Email: How To Create PDFs and email them automatically
Next post
A step-by-step guide on how to create personalized PDF using dynamic variables from Google Sheets and email them if needed.
A PDF mail merge is similar to a traditional mail merge but specifically involves creating personalized PDF documents from a template. In this process, you use a single PDF document as a template and merge it with a data source like a spreadsheet or database. The data source contains information such as names, addresses, or other details that are unique to each recipient. The mail merge process automatically inserts these details into designated fields within the PDF, generating customized PDFs for each entry in the data source. This is particularly useful for creating personalized forms, letters, labels, or certificates in bulk.
Even when the data source is something like Google Sheets and the output isn’t intended for emailing the term “mail merge” has been retained. It’s now broadly used to describe any process where template documents are automatically filled with individual data entries from a data source, regardless of whether the final product is intended for email, digital distribution, or physical mail. However, in this blog post we’ll deal with the case of sending out a personalized email with a PDF that includes dynamic variables. As emailing the PDF is the last step, you can omitt it if it is irrelevant for your use case.
Create a Google sheet you’d want to use as your database to store variables needed for personalized PDFs. Variables can be names, email address (necessary for emailing the PDFs), order details or anythin else.
Use this action to automatically preload the columns and map them to the variables in your flow. For example, you have to tell Zenphi that Name in your Google sheet should be used to replace the variable {{Name}} in your Google doc.
What this means is that the flow you’re creating will be repeated for every row. Specify the action that should be taken for each row — in this case, it’s Read a row. In other words, you’re telling Zenphi that you need it to read not just one row. But all the rows in the sheet and perform a flow you describe below for every variable.
This action will be taken not once but as a part of FOREACH flow (meaning, it will repeated multiple times).
Make sure all variables you have in your document template are mapped on this step!
You have to be authorized Google workspace Admin! You also can only use Google Workspace, not your personal Gmail account!
You can hard-code it
For this, you have to tell Zenphi that email address should be taken from the Foreach Loop action
Hard-code or use a variable from your Google Sheet
Here you can also write the copy of your email using individual variable for personalization (for example, Name). Or you can create fully personalized copy and store it in Google sheet, adding a reference to the {{copy}} variable on this stage.
Specify a dynamic value of your PDF file as an attahment.
If you’re using a link to the PDF created and saved on your Google Drive instead of the file itself, you’d want to provide access to this document to a person who receives your email without providing access to all your Google Drive.
In this case you need to add Share Access action between Generate a Document and Send an Email action.
The final step would be triggering the flow manually and make it run once to make sure everything’s correct. Check workflow logs as well.
You can also read our guide on how to automate a task of sending out confirmation emails upon Google Forms submission. Or how to automatically send out different emails based on Google Forms Control value.
We hope this guide has provided valuable insights into automating your workflow with Zenphi.
Not sure how to start your PDF mail merge automation? Let us guide you on every step! Our consultancy is free of charge.
With a robust technical acumen and proven track record in sales, purchasing, and operations, Fernanda has years-long experience in leverage Google Workspace to streamline processes and enhance productivity. Her expertise lies in automating tasks and creating efficient workflows within Google's ecosystem, driving digital transformation and team performance across various business functions.