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:
- Referrer email.
The field parsing used to identify this field isYOUR|MEMBER EMAIL. The field type should beshort textoremail. - Referee first name and last name, which may be separate or a single field.
The field parsing used to identify this/these fields isFRIEND|REFEREE|REFERRAL|LEAD|PROSPECT, and then(FIRST|FORE|CHRISTIAN)\s?NAME,(LAST|SUR)\s?NAME, orNAME. The field type should beshort text. - Referee email.
The field parsing used to identify this field isFRIEND|REFEREE|REFERRAL|LEAD|PROSPECT, and thenEMAIL. The field type should beshort textoremail. - Referee mobile.
The field parsing used to identify this field isMOBILE|PHONE|CELL|NUMBER. The field type should beshort text,number, orphone.
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:
- Sender name.
The field parsing used to identify this field isYOUR_NAME|YOURNAME|NAME. The field type should beshort text. - Sender email.
The field parsing used to identify this field isYOUR_EMAIL|YOUREMAIL|EMAIL. The field type should beshort textoremail.
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:
- 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, orNAME. The field type should beshort text. - Email address.
The field parsing used to identify this field isEMAIL. The field type should beshort textoremail. - Mobile.
The field parsing used to identify this field isMOBILE|PHONE|CELL|NUMBER. The field type should beshort text,number, orphone. - 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.