Today we’re going to take a close look at MachForm, which is a form tool that you can install directly on your PHP server.  With MachForm you can create responsive HTML forms using a drag and drop builder, and easily integrate them into your website. 

While MachForm does have a way to auto-generate a PDF of the submission, it’s difficult to customize that PDF.  With Formstack Documents you can easily create a customized document for each form you build and you’ll have access to other delivery options

In this example we’re going to show you how to automatically generate a customized invoice from an order form using MachForm.  We’ll then be able to automatically email that invoice directly to our customer for payment processing.

The first thing we’re going to do is setup our invoice document (template) in Formstack Documents.  We’re going to use the online builder to easily build the template right inside Formstack Documents.  From the Documents page, click New Document, type in a name, then choose the Build Your Own option.  Click next and you’ll be taken to the Document Builder.


In the Document Builder, we’re going to add our logo, address, and then the merge field tags for the items that we want to be in the invoice.  We’re going to add merge fields like {$name}, {$address}, etc.  These merge tags can use letters, numbers, and underscores (no spaces or special characters.  Here’s what our template looks like:


After you’ve saved your template, we can jump over to the Deliver tab to setup the email that will go to our customer.  You’ll see there’s already an email delivery setup, so we’re just going to edit that.  Under the “To” we’re going to pick Merge Field then choose the merge field for our customers email address. If you didn’t add a merge fields to your template for the email address, choose <<other>> then type in a field like {$email_to}.

Go ahead and update any of the other email settings and save.

The last step before we jump over to MachForm is to go to the Merge tab for your document.  On this page you’re going to see the Merge URL for your document.  This is a unique URL for your document and we’ll use this in the MachForm settings to send data to our document.  Copy that URL and let’s head over to MachForm.

Inside MachForm, go to the Notifications section and then check the box to “Send Form Data to Another Website”.  This will open the settings that will send data to Formstack Documents.  For the Website URL, enter the Merge URL for your document.  You’re going to want to use HTTP POST and send the name/value pairs.

In the parameters section, this is where we’ll define how to send the data to Formstack Documents so that it merges with our invoice correctly.  For each of your merge fields that you setup, you’ll want to add a parameter using the same name and then map it to the corresponding field on our form.  Here’s what our settings look like:

Once you save those settings, you’re done!  Every time you get a new order through the form, that data will be automatically sent over to Formstack Documents and your invoice will be generated and emailed to your customer.  Here’s an example of our invoice:

Congrats!  You’ll never have to manually create an invoice again.  Can you think of other ways that you can use Formstack Documents to automate your paperwork?

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



Please sign in to leave a comment.