Setting Up Form-Based Web Leads

This guide outlines the steps for configuring aACE to download and process email-based leads after you have set up your Mailgun subdomain. The overall process is as follows:

  1. A form is submitted on your website using your solution of choice and details are sent to your Mailgun subdomain (e.g.
  2. Mailgun receives and stores the email.
  3. Optionally, Mailgun forwards the email to an email address of your choice.
  4. aACE queries Mailgun, downloads the email lead, and parses the data to create an aACE Lead.

Step 1: Prepare the Web Form

Create a web form that can be inserted into your website. There are many available tools for this and aACE Software has no recommendations about which solution to use. The only requirement is that the form can be automatically emailed to your Mailgun subdomain (e.g. 

Step 2: Set Up Mailgun

Review the documentation on setting up and configuring Mailgun.

Step 3: Create a Forwarding Route in Mailgun (Optional)

This step is only necessary if 1) you want responses to be delivered to multiple email addresses, and 2) your web form does not support this. (Note: This can also be useful when setting up this feature to ensure the overall process has been configured properly.)

  1. Log into your Mailgun account.
  2. In the left-hand panel, click Routes
  3. Click Create Route:
    • Expression type: Match Header
    • Header name: To
    • Header value: Enter the email address that web leads will be sent to (e.g.
    • Forward: Enter other email addresses that copies of the web leads will be sent to (if any)
    • Priority: 0

Send a test email to the Mailgun email address indicated above (e.g. Note: You must send this test from an email address not configured to receive the forwarded emails. For example, configure the forward to go to your business email address, but send the test from a separate personal email address.

Step 4: Set Up Parsing Logic in aACE

  1. Navigate to Menu > CRM & Sales > Contacts, then create a new contact with the email address that will receive email leads (e.g. This will ensure that email leads are properly downloaded into aACE and not flagged as junk.
  2. Navigate to Menu > System Admin > Preferences > Database Management > E-Commerce Integration: Open Settings > Email Leads.
  3. Mark the flag to Enable Email Leads, then fill out the leads form:
    • Subject — A phrase that will be common for all email leads (e.g. Web Form)
      aACE will query any emails that have this value in the subject line. The full subject line for each lead email can be unique, but they must include this common element (e.g. Web Form – XYZ Company).
    • Content — Labels and merge fields to replicate the data from the web form (see example below)

Example of Email Lead Content

The Content field should replicate your web form, using the aACE merge fields that are displayed next to the Content field. A simple way to begin populating the Content field is to submit a test form from your website. That email will download into the aACE Emails module. Locate the email, copy the filled form from the email body, paste the form data into the Contents field, remove all formatting by pressing ⌘-Z (CTRL-Z on Windows), then replace each data point with the equivalent merge field.

For example, suppose that aACME Education's web form included these fields (with sample data):

  • Company Name: aACME, Inc.
  • Name: John Smith
  • Address:

123 Main St
Anywhere, NY

  • Phone: 555-555-5555
  • Email Address:
  • How did you hear about us?: Google

The web form Content in aACE would be structured like this:

Additional Notes About Web Form Content

Email Formats

This process will not parse HTML emails. If your web form sends emails in HTML format, you will need to use the text version when setting up the content.

Punctuation & Spacing

All commas, colons, spaces, carriage-returns, etc, that are present in the form must be present in the Content field.

Form Content with No Merge Field

Some fields on your form may not have a corresponding field in aACE (e.g. lead source). In the Content field, these data points must still be designated. Use the "NoMapping" placeholder to ensure these fields are ignored when content is parsed.

Parsing Content

Note: Automatically transferring data from the Web to your aACE system requires close attention to detail. It is unlikely that the first attempt will create perfect results. Plan on using trial and error, testing fully, and working patiently.

For more reliable parsing of form data, split each data point into its own attribute. For example, the above sample Address combined the city and state; the content would parse even better if they were split out:

  • Street: 123 Main St
  • City: Anywhere
  • State: NY
  • Zip Code: 10001

When the process downloads an email lead, aACE parses the contents of the email as best it can. Given the open-ended nature of most web forms though, the results may not be perfect every time because they depend on what is input. For example, if somebody enters "street" in the street field, that may interrupt the parsing. Some data may need to be fixed manually. To accommodate this and to ensure you have easy access to the details, the lead record is linked to the aACE Email record that is created and the contents of the email are placed in the Lead Notes field.