Zapier Guide

Sending PostGrid Print & Mail with Zapier

When your business requires sending mail in an effective in scalable manner, PostGrid has your solution. In this guide, we will examine how to send Print & Mail using Zapier's integration with PostGrid.

Zapier is a product that allows end users to integrate the web applications they use and automate workflows.

Overview

There are five stages in the process of sending letters with PostGrid:

  • Creating a Zap
  • Creating a Trigger for the zap
  • Creating an Action for the zap
  • Linking your PostGrid account
  • Filling in required fields for your order

Zapier Dashboard

We begin our process right at the dashboard after logging in.

Creating a Zap

On the Zapier dashboard, click the orange Create Zap button placed on top left of the page.

Creating a Trigger

A trigger is an event that starts the Zap.

In this guide, we will use a sample spreadsheet present on Google Sheets. We thus select the ‘Google Sheets' app and set our trigger event to ‘New Spreadsheet Row'.

Next, we select our account for the trigger app. In this case, we sign in to our Google account to allow Zapier access to our Google Sheets spreadsheets.

Our next step is to select the desired spreadsheet and worksheet.

We can then choose to test our trigger by clicking continue and then the Test Trigger button to confirm that we have chosen our options correctly in the previous steps.

Zapier returns a piece of information from our provided spreadsheet. Verify this information and click continue to move on to the next step, creating an action for our zap.

Creating an Action

An action is an event the Zap performs after it starts.

In this step, we search for and select the PostGrid Print & Mail app.

Next, we are required to select one of the following events from the Event dropdown.

In our case, we wish to create a letter so we choose that option and then click continue.

We are then asked to select our PostGrid Print & Mail account. To do this, we enter the API Key that can be found in the Settings section of our PostGrid dashboard.

Note: Please be sure to enter the ‘Test API Key' if you wish to test orders and the ‘Live API Key' only if you are sure about your order.

Once we have selected our account, we move on to entering the given fields for our letter. It is important to enter all required fields to continue to the next step.

As shown above, Zapier gives us the option to enter text or insert variable data into the fields from the provided spreadsheet.

Creating or retrieving the HTML

If you've created your template using HTML, you can use that directly in Zapier. If you've used our template editor to create your template (see Creating Templates using the Dashboard), you can copy its HTML for use on Zapier via the Raw Data section:

Copying raw data from an editor-generated template.

You can paste this into the HTML section on Zapier. You can then insert your variables directly into the HTML just like you would with the Recipient First Name and other fields.

Inserting a variable into the HTML section of the Zap.

Some required fields like the Color and Double sided take the values of true or false. We want our letter to be of color but not double sided so we select True for the Color field and False for the Double sided field.

If the Continue button is disabled, we have missed filling a required field and we return to click continue once we have filled all required fields.

Zapier, then prompts us to verify the data we entered and to test creation of the letter.

It is recommended to proceed with the ‘Test and Review' button.

At this stage, the zap can be published if the testing provides desired results. One can also chain similar triggers and actions to further enhance their workflow. Zapier provides built-in actions such as the following:

Send PDFs with Zapier & PostGrid

How to Send PDFs with Zapier and PostGrid

When your business requires sending mail in an effective in scalable manner, PostGrid has your solution. In this guide, we will examine how to send Print & Mail using Zapier's integration with PostGrid.

In this guide, we will walk through several different cloud platforms as well as a solution you can use right from PostGrid's dashboard to get your PDF URLs setup and going without issue.

Appropriate Zapier Fields

Before getting into how we can host our PDFs to use with Zapier, let's first get our Zap setup.

Importantly, before starting any Zapier integration, you must ensure that your PostGrid app is the latest version.

Once you have the app setup, chose which collateral you want to send out, and entered your API key, we can now see the fields of the Zap.

Below are the corresponding fields you will want to enter your PDF URL into.

Create Letter

Create Postcard

postcard template

Create Cheque

Note that for cheques, the message will be what is printed on the top two-thirds of the cheque page and the letter PDF URL will be mailed as an attachment.

Google Drive

For Google Drive, you will need to make the resource in question publicly available.

Once you have the sharing link for your PDF, then you can generate the link in the following way (with the example above):

  1. Grab the shareable URL: https://drive.google.com/file/d/1czrnVgK7nBj4SdI0beoB3AZ9CLlZrCQ2/view?usp=sharing
  2. Select the ID: 1czrnVgK7nBj4SdI0beoB3AZ9CLlZrCQ2 (https://drive.google.com/file/d/1czrnVgK7nBj4SdI0beoB3AZ9CLlZrCQ2/view?usp=sharing)
  3. Place that ID into this link scheme: https://docs.google.com/uc?export=download&id=_(ID)_ (https://docs.google.com/uc?export=download&id=1czrnVgK7nBj4SdI0beoB3AZ9CLlZrCQ2)

With the final URL, you will be ready to include the attached PDF directly into your Zap.

Dropbox

Dropbox is another popular service for storing data on the cloud and can be used for storing your PDF.

To begin, you will want to simply right-click on your file and select ‘Copy link'.

From here, you should create a URL which looks something like this: https://www.dropbox.com/s/ofhiufh09384/SimplePDF.pdf?dl=0.

To allow using this with Zapier and PostGrid, simply adjust the value of dl=0 to dl=1 at the very end of the URL.

With this, you can now use the link with your Zap and be set to go.

Amazon S3

Of the options seen here, S3 is one of the more developer friendly option which is much less difficult to share.

As such, you may either share your PDF with a long lasting pre-signed URL or though a variety of public access permissions.

Pre-signed URL

This method is fairly simple as you can upload your PDF, select “Object actions” while viewing it, and then choose to generate a pre-signed URL.

However, as with all pre-signed URLs, this can only be temporary and removes the “forget” component of set-and-forget with Zapier.

Here we can only set to share this for a week before needing to regenerate our URL and update our Zap.

ACL

Another easy option is to edit the object's Access Control List (ACL).

For this, we will simply want to view the permissions of the object and then edit the ACL.
From here, we just want to make sure that we allow public access for everyone.

Once it is publicly accessible, you can simply share it with the object URL.

Bucket Permissions

The final way to share your PDF with S3 is through bucket permissions.

If you would like to have a folder in your bucket where everything is publicly accessible, you simply have to add a statement to your bucket policy.

Here is an example statement which shares the contents of a folder public in a bucket example-bucket.

{ "Version":"2021-10-17", "Statement":[ { "Sid":"AddPublicPerms", "Effect":"Allow", "Principal":"*", "Action":"s3:GetObject", "Resource":"arn:aws:s3:::example-bucket/public/*" } ] }

With this bucket policy, anything added to the folder public can be shared using the object URL as before.

PostGrid Dashboard

This final method actually circumvents the need to host a PDF altogether, but can only be used for letters and postcards.

For this method, we will want to navigate to the PostGrid dashboard to create a template.

Next, be sure to setup the appropriate collateral and destination you intend to send out your PDF with.

Once you have your template open, you can now begin to add the pages of your PDF as images.
For more details, be sure to see our guide for navigating the template editor.

When it comes to getting your PDF into images, there are many resources available online or through popular PDF viewing files such as Adobe Acrobat.

Optionally, you may simply take screenshots of your PDFs, but this may lessen the quality of the page.

If there is any size mismatch, you can simply select the “Fit to background” option which should aline your document with the page.

For letters, you can simply add each page individually using the “Add new page button” which is the plus sign just above the document.

With respect to postcards, you will need to repeat this process making one template for the front and one template for the back.

Once you have everything setup, you may now save your template and exit the editor to find some generated HTML.

You can use this HTML in the HTML sections of your Zap and everything will be set to go from there.

For the appropriate fields to enter this HTML into, you can see the corresponding fields in the earlier section on setting up the Zap.

Importantly, you cannot use this solution for attaching letters to cheques as those will only accept PDF URLs.

We Integrate with the
Platforms You Love

Integrate PostGrid Print & Mail APIs with your choice of tech stacks, CRMs, and apps to save time and effort.

View All Integrations

Ready To Get Started?

Start transforming and automating your offline communications with PostGrid