Note: here is another tutorial for generating PDFs from emails received from “Email by Zapier” or from any other source providing parsed emails.
What is Zapier?
Zapier is an online automation tool that connects your favorite apps, such as Gmail, Slack, Mailchimp, and over 1,500 more. You can connect two or more apps to automate repetitive tasks without coding or relying on developers to build the integration. It’s easy enough that anyone can build their own app workflows with just a few clicks.
In the tutorial below, you will learn to convert an email to a PDF file as well as save a Gmail email as a PDF.
We prepared this step-by-step tutorial with screenshots on how to make a Zap using PDF.co, and Gmail, to automatically convert HTML to PDF from Gmail email.
- Make a Zap
- Add Gmail App
- Choose a New Email
- Connect Gmail Account
- Customize Email
- Test and Continue
- Add PDF.co App
- Anything to PDF Converter
- Add PDF.co Account
- Setup PDF.co Action
- Test and Review
- Test Result
- HTML to PDF Output
TL;DR:
- Start by clicking on Make a Zap! at the top-right corner of your Zapier dashboard
- Under “When this happens …” Choose App & Event search and select Gmail from the list of apps
- Under Choose Trigger Event select New Email in Gmail
- Select or connect your Gmail account to Zapier
- Select the Folder on your Google Drive where input documents will be added
- On the Find Data step send an email to the mailbox/label you selected before and click TEST & CONTINUE
- Under “Do this …” Choose App & Event search and select PDF.co from the list of apps
- Under Choose Action Event select Anything to PDF converter
- Select or connect your PDF.co account to Zapier
- Under Customize Pdf To Anything set the Source Type to Raw HTML code as a string and the Input to Body HTML
- On the Send Data step click TEST & REVIEW, the returned URL is a direct link to the converted file.
- When the request is processed successfully, PDF.co will return a temporary URL
- We have successfully converted the Gmail email to PDF and this is what it looks like.
Step 1:Make a Zap
- Start by clicking on Make a Zap! at the top-right corner of your Zapier dashboard.
Step 2: Add Gmail App
- Under “When this happens …” Choose App & Event search and select Gmail from the list of apps.
Step 3: Choose a New Email
- Under Choose Trigger Event selects New Email in Gmail.
It should look like this up until this point:
Step 4: Connect Gmail Account
- Select or connect your Gmail account to Zapier.
Step 5: Customize Email
- Select the Inbox/Mailbox in your Gmail that is to be converted when a new email arrives.
Step 6: Test and Continue
- On the Find Data step send an email to the mailbox/label you selected before and click TEST & CONTINUE.
Step 7: Add PDF.co App
- Under “Choose App & Event” search and select PDF.co from the list of apps.
Step 8: Anything to PDF Converter
- Under Choose Action Event select Anything to PDF converter.
Step 9: Connect PDF.co Account
- Select or connect your PDF.co account to Zapier by adding the API Key. You can get the API Key in your PDF.co dashboard.
Step 10: Setup PDF.co Action
- Under Customize Anything to PDF set the Source Type to Raw HTML code as a string and the Input to Body HTML. At this point, optional parameters such as the output file Name can be defined.
Step 11: Test and Review
- On the Send Data step click TEST & REVIEW, the returned URL is a direct link to the converted file.
Step 12: Test Result
- When the request is processed successfully, PDF.co will return a temporary URL to access the converted email to PDF. Kindly copy and paste the URL into your browser to view the result.
Step 13: HTML to PDF Output
- We have successfully converted the Gmail email to PDF and this is what it looks like. You can customize the look of the email by adding your personalized HTML code.
Screenshot of the Email converted to PDF Output
Check if everything works correctly and without errors then hit RETEST & CONTINUE
Give a name to your Zap at the top-left corner, then hit Done Editing, you can then TURN ZAP ON
Depending on your Zapier plan and settings, your Zaps will trigger and the output and logs can be found in your Tasks History.
NOTE: Consumer Gmail users might encounter approved app issues. We recommend that you use a Business Gmail account or send the emails through Zapier Mailhook. For more information, please refer to this link.
Check out this video tutorial on how to convert Gmail email to PDF: