Automatically generate documents from template and send to Xodo Sign for e-signing

In this example, we’ll create a sales contract from a Word template, convert it to PDF, and send it to Xodo Sign for electronic signing using Plumsail Documents Processes.

Here’s an example of the signed contract:

Contract signed with Xodo Sign

To follow this guide, you’ll need a Plumsail account. If you don’t have one yet, sign up for a 30-day free trial.

Create process

First, navigate to the Processes section in your Plumsail account. Click Add Process and select the option to start from a ready-made template.

Add a new process from a premade template

Find and select the Sales of goods contract template.

Select the sales of goods contract template

Next, enter a name for your process, select PDF as the Output file type, and click Create to continue.

Name and create process

Configure template

Once the process is created, you’ll see a preview of the selected template.

Click Edit online to customize it in the online editor, or upload a different template file if needed.

Edit template

Templating syntax

You may notice {{tokens}} throughout the sales contract template. These are placeholders used to insert dynamic data into the document.

The templating engine recognizes expressions enclosed in {{curly braces}} and replaces them with the corresponding data when generating a document.

Our sales contract template includes a table with product details. Tokens such as {{products.name}} and {{products.quantity}} refer to properties of objects in the products collection. The engine automatically generates a table row for each product.

The template also uses functions to format currency values, such as {{products.price|format(C, en-US)}}, and calculate the total cost using {{totalCost=products|sum(cost)}}.

Tokens and formatting functions in the template

For more details on tokens, formatting, and calculations, see the Word templating documentation.

Insert signing tags into the template

To define where recipients should sign the contract, we’ve added Xodo Sign signature tags to the end of the template. These tags specify the location and type of fields that signers need to complete.

Here’s how the tags appear in our template. We’ve highlighted them in black for demonstration purposes, but you can set their text color to white to hide them in the generated document.

Xodo Sign signature tags

When the document is sent for signing, Xodo Sign converts these tags into the corresponding fields:

Xodo Sign signature tags result

Xodo Sign tags are enclosed in [square brackets] and contain parameters separated by the | symbol.

The first parameter defines the field type, such as sig for a signature, text for a text field, such as a full name, or date for a date field.

Learn more about using Xodo Sign signature and other related tags.

Test document template

To preview the generated contract, click Test template. A dialog will open with an automatically generated testing form based on the tokens in your Word template.

Fill in the fields with sample data to check the result. You can also test the template using JSON data or customize the testing form by changing token types.

Test template Xodo Sign

Once you’re satisfied with the result, click Save to continue.

Configure settings

After testing the sales contract template, you can adjust the process and template settings. Click the gear icons to open the corresponding settings:

Configure template settings

Process settings control how the process runs. Here you can configure:

  • Process mode. By default, new processes are in Testing mode. Documents generated in this mode have a Plumsail watermark, but executions are free. Switch to Production mode to generate documents without the testing watermark.

  • Timezone and locale. Define how dates, times, and numbers are formatted.

  • Output files. If your process contains multiple templates, you can choose how the generated documents are combined: keep them as separate files, merge them into a single PDF, or package them into a ZIP archive.

Template settings control the generated document. Here you can configure:

  • Template name. Set a name to identify the template within the process.

  • Output filename. Customize the generated file name using tokens from the template.

  • Output file type. Choose the format of the generated document. In this example, we’ll select PDF to send the contract to Xodo Sign.

  • Template engine. Select the Modern or Classic engine depending on the syntax used in your DOCX template. Modern is selected by default.

  • Conditionally run template. Set conditions to generate the document only when specific criteria are met.

When PDF is selected as the output type, you can also configure additional options, such as adding a watermark or protecting the document with a password.

Send document to Xodo Sign for signing

Next, configure the delivery to send generated contracts to Xodo Sign for electronic signing.

In the Delivery step, select Xodo Sign from the available options.

Add Xodo Sign delivery

Connect your Xodo Sign account to Plumsail Documents.

Connect to Xodo Sign account

Once connected, configure the delivery settings:

  • Business. Select the Xodo Sign business account to use.

  • Email subject and message. Specify the email subject and body that recipients will receive. You can use tokens from the document template to personalize them.

  • Recipients. Add the recipients and assign their roles: Needs to sign or Receives a copy. In our example, we have two recipients who need to sign the contract.

  • Signer PINs. Optionally, click the lock icon next to a recipient to set a PIN for additional security.

Configure Xodo Sign delivery settings

Expand Advanced to configure additional options. In our example, we’ll enable:

  • Sequential signing. Recipients must sign the document in the specified order. You can change the order by dragging and dropping recipients.

  • Require all signers to sign. The document is completed only after all required signatures are collected. If a signer declines, the document is canceled.

You can also configure document expiration, reminder notifications, and Sandbox mode for testing.

The Files to deliver setting lets you choose which generated files to send when your process uses multiple templates.

Xodo Sign advanced delivery settings

Your Xodo Sign delivery is now configured. You can add multiple deliveries to the same process if needed, such as saving a copy of the generated contract to SharePoint or OneDrive. See the full list of available deliveries for more options.

Start process to generate documents and send them for signing

Your process is now ready. Click Run process to see the available options for starting the process.

Run process button

In this example, we’ll use a Plumsail Web Form. Each form submission will trigger the process, populate the sales contract template with the submitted data, and send the generated PDF to Xodo Sign for signing.

Here’s what our web form looks like:

Web form for sales contracts

You can download the ready-made form. To download the JSON file, right-click the link and select Save Link As….

Next, go to Forms in your Plumsail account and click Create form to open the Plumsail Forms designer. There, import the downloaded JSON file:

Import form to web designer

Save the form, and it’s ready to use. You can also customize it to suit your needs. For more details, see the documentation on how to design web forms.

Bind web form to process

Now, connect the web form to your Documents process.

Click Run process and select Web Form. An automatically generated form will open. Click the back arrow in the upper-left corner to return to the form management menu.

Bind a Plumsail web form to the Documents process

In the dialog, click Bind existing form and select your form from the list of available Plumsail Forms and click Bind.

Select a form to bind to the process

Once the form is bound, each submission will automatically start the process. Plumsail Documents will populate the Word template with the submitted data, generate a PDF contract, and send it to Xodo Sign for electronic signing.

Integrate with your services

You can also trigger the document generation process from other services using integration platforms such as Zapier and Power Automate.

For example, you can automate contract generation and signing using data from:

Explore more possibilities in the integrations section.

If you have any questions or need assistance, contact us at support@plumsail.com.