Skip to content Skip to main navigation Skip to footer
Loading GymOS audio player...

Generic HTTP post form handler

FitnessHub provides a handler function for processing generic form submissions created with the landing page form builder.

In most cases, when you use templated forms or embed a campaign form, you do not need to concern yourself with this handler’s operation. This information is provided for advanced users with sufficient technical understanding who wish to build their own form email process.

Restrictions

The FitnessHub form handler is designed solely for processing forms embedded in FitnessHub pages. It will not operate for forms embedded in other domains, and you will receive a 403 Forbidden error if you try.

Handler Modes

The handler has four modes:

  • Refer a friend
    This mode fronts the refer-a-friend function, enabling referrals to be made from a custom form directly into the refer-a-friend functionality.
  • Contact us
    Used to collect a contact enquiry, with the data routed into a message within the message centre.
  • Lead capture
    Seldom used due to the superior campaign form embedding option, but can be used to front the lead capture element of a campaign.
  • Generic
    A generic data capture, for which the data is formatted as an HTML email and injected in to the message centre.

The mode is determined by the presence and value of a hidden gymoshandler field in the form.

Endpoint

The form-handling endpoint on your FitnessHub site is /formsubmission. It accepts POST requests only.

Refer a friend

The accepted gymoshandler values for this mode are referafriend, refer, or referral.

For the refer-a-friend processing to operate, the following fields must be included and identifiable within the form:

  1. Referrer email.
    The field parsing used to identify this field is YOUR|MEMBER EMAIL. The field type should be short text or email.
  2. Referee first name and last name, which may be separate or a single field.
    The field parsing used to identify this/these fields is FRIEND|REFEREE|REFERRAL|LEAD|PROSPECT, and then (FIRST|FORE|CHRISTIAN)\s?NAME, (LAST|SUR)\s?NAME, or NAME. The field type should be short text.
  3. Referee email.
    The field parsing used to identify this field is FRIEND|REFEREE|REFERRAL|LEAD|PROSPECT, and then EMAIL. The field type should be short text or email.
  4. Referee mobile.
    The field parsing used to identify this field is MOBILE|PHONE|CELL|NUMBER. The field type should be short text, number, or phone.

In the event that the necessary data is not identified, the form process shall revert to a generic post.

Contact us or Generic

The accepted gymoshandler values for this mode are contact or contactus.

For the contact form processing to operate, the following fields must be included and identifiable within the form:

  1. Sender name.
    The field parsing used to identify this field is YOUR_NAME|YOURNAME|NAME. The field type should be short text.
  2. Sender email.
    The field parsing used to identify this field is YOUR_EMAIL|YOUREMAIL|EMAIL. The field type should be short text or email.

In the event that the necessary data is not identified, the form shall gather and provide as much information as it can within the message injected into the mail centre.

Lead Capture

The accepted gymoshandler values for this mode are lead, or leadcapture. Additionally, the “submission type” in the form configuration should be set to Standard form submission.

For the lead capture processing to operate, the following fields must be included and identifiable within the form:

  1. Lead first name and last name, which may be separate or a single field.
    The field parsing used to identify this/these fields is (FIRST|FORE|CHRISTIAN)\s?NAME, (LAST|SUR)\s?NAME, or NAME. The field type should be short text.
  2. Email address.
    The field parsing used to identify this field is EMAIL. The field type should be short text or email.
  3. Mobile.
    The field parsing used to identify this field is MOBILE|PHONE|CELL|NUMBER. The field type should be short text, number, or phone.
  4. Custom questions
    Additional form fields are treated as “custom questions” and added to the response document recorded against the lead campaign record.

If the required fields cannot be identified, the form handler shall revert to the generic process.

If the landing page’s campaign is a lead-capture campaign, the form handler shall redirect the user to the thank-you page URL. For other campaign types, it shall bounce them to the next element in the campaign form.

Regardless of campaign type, if the form is incorrectly submitted as a JSON submission, a lead record will be created, but GymOS will be unable to process the submission any further.

Related Articles