🎉  Build a workflow powerhouse. Learn more about our new Airtable integration.   🎉

May 16, 2018

Automatically Populate Thank You Letters from Pipedrive

Using a tool like Pipedrive to manage your sales process can be a great way to close more deals, faster.  Your whole sales team can see the status of a deal and make sure nothing falls between the cracks.  Add WebMerge to your workflow and you can instantly populate all kinds of sales documents like contracts, quotes, invoices and more.

In this example, we’re going to show you how to automatically populate a thank you letter when we close a deal in Pipedrive.  We’ll then use Lob to print, stuff, and mail the letter directly to our customer.

To get started, we’re going to setup the template for our letter using a Word document.  Inside Word, we’re going to add our repeating letter information like our logo, address, etc.  Then for the spots that we want to insert our customer/deal info, we’re going to use merge fields that look like {$FirstName}, {$LastName}, etc.

Here’s what our letter template looks like:

Once we have our template ready, we need to upload it to WebMerge.  From the Documents page in WebMerge, click the New Document button and enter a name.  On the next step, select Office Document as the document type then pick the file from your computer.

After you’ve uploaded your template to WebMerge, you’ll be taken to the Settings tab where you can modify various options like the type of file that is generated and the name of the file.  In this example, we’re going to include the name of our customer in the file name and produce a PDF output.

We’re also going to turn on Debug Mode by checking Test Mode at the bottom of the page and check the box to save data for debugging.  Then under Advanced Settings, we’re going to turn on the Field Map.  We’ll use this later.

After we’ve saved our settings, we are going to setup the delivery of our document to Lob so that it is automatically printed and mailed to our customer.  Under the Deliver tab, click the New Delivery button and select Lob from the list.

After you enter your Lob API Key, you’ll need to enter the merge fields that are used for your customer’s address.  If you don’t have those fields in your template, choose <<Other>> from the dropdown and enter new merge fields like {$StreetAddress}.

Once you’ve saved your Lob delivery, we are going to setup the integration between Pipedrive and WebMerge.  To help with the integration, we’re going to use “Webhooks” in Pipedrive which will trigger a merge when we update a deal in Pipedrive.

To setup your Webhook URL, you’re going to use this script: https://www.webmerge.me/scripts/pipedrive

We’re going to enter our Pipedrive API Key, then the Merge URL for our document (found under the Merge tab in WebMerge).  We’re only going to send this letter when a deal is marked as “Won” so we’re going to add a filter for “status” with the value “won”.

You’ll want to copy this Webhook URL that is generated and go into Pipedrive and setup a new webhook under Settings.  You’ll enter your URL then select Deal is Updated as the trigger.

Next, we’re going to run a test so that we can see the data that’s coming over from Pipedrive.  Open up a test deal, then mark it as Won. 

If you login to WebMerge and go to the Overview tab of your document, you should see a recent merge.  Go ahead and click the View Data button on that page and you can see the data we’re receiving from Pipedrive and if you click on the name of the field it will show you the merge field to use in your Field Map (or document).

To match the Pipedrive fields with your merge fields, you’ll need to copy & paste the codes from the View Data popup into our Field Map.  Or you can simply update your template to use the Pipedrive fields.  Here’s what our Field Map looked like:

Once you’ve matched up all of your merge fields, go ahead and save then let’s run another test!  All of the fields should be populated correctly in our document now.

Here’s what our letter looked like ready for mailing!

Congrats, you’re all done!  You can now automatically populate all types of documents from your Pipedrive account.  Can you think of any other ways you can use WebMerge to simplify your paperwork process?

7 min read

Ready to give Formstack Documents a try?
Start your Free Trial now!


Send Letters from Pipedrive Now

By signing up here, you agree to our Terms of Use