Filing your court documents is an important part of the legal process and can also be time-consuming.  However, many courts still accept filings via fax and that can be a great way to save time.  Especially when you use a service like Formstack Documents to automatically generate the court documents and send them via fax service like Phaxio.

In this example, we’re going to show you how you can generate court documents with the click of a button from Salesforce and automatically fax them to the court using Phaxio.  We’ll be using our friends over at Zapier to help send the fax with Phaxio.

To get started, we’re going to set up our document (template) in Documents.  We’ll be using a Fillable PDF as our template.  This PDF will have a field for each piece of information we’ll be pulling from Salesforce.

Here’s what our document looks like:

When your PDF is ready, let’s upload it to Documents.  From the Documents page, click the New Document button then type in a name for the document.  On the next step, choose I have a document I would like to use and then select the PDF file from your computer.


After you’ve uploaded your PDF, you’ll be taken to the Settings tab for your document.  On this page, you can update things like the type of file that is produced and the name of the merged file.  For this example, we’re going to generate a PDF and we’re going to include the First and Last Name in the file name.


Once you’ve saved the settings, you’re going to be taken to the Deliver tab.  This is where you can define how you want the merged document delivered.  To send the document to Phaxio, we’re going to set up a new Phaxio delivery.

In the Deliver tab, click on the New Delivery button and find the Phaxio delivery option from the window that appears.  After selecting the Phaxio delivery option, you will see the following:


  • Phaxio API Key/Secret - These fields will need to be populated with an API key and API secret from your Phaxio account.  In Phaxio, this can be found under the API Keys option in the main menu.
  • "To" Number - This is the fax number that the document will ultimately be sent to.  You can choose to enter a static value or a dynamic value by utilizing a merge field (e.g., {$To_Fax_Number})

Additional options can be configured by clicking on the More Options button:


  • Always send to Phaxio - Similar to other delivery methods, unchecking this option will allow you to use conditional logic to determine if the delivery should execute.
  • Customize Header Text - Enabling this option will allow you to add custom header text to the request that is sent to Phaxio.
  • Use custom Caller ID - When enabled, this option allows you to use a custom caller ID.
  • Send callback notifications to - This option allows you to send callbacks from Phaxio to a specified URL (such as a Webhook) once the delivery is made.
  • Delay this delivery - Enabling this option will allow you to delay the delivery until a custom date or until a specified number of days has passed.
  • If an error occurs, send an email to - This option allows you to send an email to a specified address in the event that Formstack Documents is not able to complete this delivery (e.g., if Phaxio's API is down or there is something wrong with the API key or secret provided)

Once you have configured the delivery settings, click the Save Delivery button.  Now, you’re ready to set up that last piece of the puzzle and integrate with Salesforce.
If you have not done so already, please install the Documents managed package from the AppExchange and follow the setup instructions here.

Inside Salesforce, we are going to set up a New Mapping that will serve as the integration point between our Salesforce data and template.  From the WebMerge Mappings tab, click the New WebMerge Mapping button.  We’re going to select the Case object and then pick our template that we just set up in WebMerge.


On the next step, you’re going to scroll down to the Field Mapping section on the page.  This is where you’re going to match up the Salesforce fields with the merge fields that are in your template.  For each merge field (listed on the left), go ahead and pick the corresponding SF field from the dropdown on the right.

After you have all of the fields matched up, go ahead and click the Save and Activate button at the bottom of the page. 

Now, it’s time to run a test!  Go ahead and jump over to one of your cases and click the WebMerge button on the page.  This will take your case information, and send it over to Documents, and populate our PDF and then send out the webhook which will deliver the document to Phaxio for faxing!

Here’s what our court document looked like after merging:

Congrats!  You can now send faxes from Salesforce using Phaxio with the click of a button.  Can you think of any other ways that you could use Formstack Documents to simplify your paperwork process?

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.