Merge an Email and Its Attachments into One PDF Using Zapier
In this tutorial, we will show you how to set up the Email by Zapier so you can receive emails directly in your Zap. Receive an email through Email by Zapier, convert its message body to PDF, and combine it with its attachments using PDF.co.
Step 1: Set Up the Email Trigger
Create a Zap and select Email by Zapier → New Inbound Email.
Configure the email address and copy the full address provided by Zapier. Send a test email to that address with an HTML-formatted message and a supported attachment, such as a PDF or Word document.
Test the trigger and confirm that the results include the message’s Body HTML and attachment file.
Step 2: Convert the Email Body to PDF
Add PDF.co → HTML to PDF Converter.
Connect your PDF.co account using OAuth by signing in and authorizing Zapier.
Configure the action:
- HTML or URL Input: Map Body HTML from the email trigger.
- Page Orientation: Select Portrait.
- Page Size: Choose A4 or Letter.
- Name: Enter
email-body.pdf.
Leave HTML Template ID blank because the input is the email’s HTML content.
Test the action and open the returned url to check the result. This converts the message body; email headers such as the subject and sender are not automatically included. See the HTML to PDF documentation.
Step 3: Merge the PDF and Attachments
Add PDF.co → PDF Merger and use your connected account.
Configure the action:
- Source Files URLs: Map the HTML conversion step’s
url, type a comma, and then map the email trigger’s attachment link. - Automatically Convert Non-PDF Files: Select True.
- Output File Name: Enter
email-with-attachments.pdf.
Putting the email-body PDF first places it before the attachments in the merged document. Insert the actual mapped values using Zapier’s field picker.
If the trigger provides attachments as a ZIP file, use that file’s link. PDF.co can extract and merge supported documents from the archive. Attachments must be supported document or image formats—not arbitrary file types.
See the PDF Merger documentation for configuration options.
Step 4: Test and Save the Result
Test the merge action and open its output url. Confirm that the PDF contains the email body followed by the attachment content.
To keep a permanent copy, add Google Drive → Upload File, select a destination folder, and map the merge step’s url to File.
Test the upload, then publish the Zap. New emails sent to the configured address will be converted and combined with their attachments automatically.
Related Tutorials
