Recipe: Setting up a contact form with Gravity Forms

Goal

Add a Contact Us form to your mobile app where the form structure is designed in the Gravity Forms UI — useful when you want drag-and-drop field management, Gravity Forms conditional logic, or Gravity Forms add-ons (Salesforce, HubSpot, Mailchimp, etc.).

If you don’t need Gravity Forms-level customization, use Recipe: Setting up a contact form (default path) instead. It’s simpler and requires no third-party plugins.


Prerequisites

  • WordPress admin access
  • MAM Suite installed, with mam-main and mam-contact-form activated
  • Gravity Forms installed and activated
  • MAM Gravity Forms plugin activated (this is the bridge plugin between Gravity Forms and the MAM form handler)

If any of those are missing, install them before continuing. The contact form will fall back to the default path (with the built-in handler) if Gravity Forms is absent — but the steps below assume the GF path is what you want.


How submission flow works on this path

Mobile app POSTs the form data
  └── mam-gravity-forms-manager processes the GF submission
        └── apply_filters( 'mam_gravity_forms_after_form_processed_{form_id}', $values )
              └── mam_contact_form_manager::process_contact_form( $values )
                    ├── Builds one notification per administrator (or per Reason mapping)
                    ├── do_action( 'mam_notification_send_message', $messages )
                    ├── do_action( 'mam_contact_form_contact_processed', $values, $form_data )
                    └── Returns the GF default confirmation message back to the app

The Gravity Forms entry is saved by Gravity Forms itself as part of process_form. The plugin only fires after that has happened.


Steps

1. Create the Gravity Forms form

In WP Admin, go to Forms → New Form. Name it whatever you like (for example, “Contact Us”). Add the following six fields, in order:

Field label Gravity Forms field type
Name Single Line Text
Email Email
Phone Phone
Contact Reason Drop Down (or Single Line Text if you don’t need routing yet)
Subject Single Line Text
Description Paragraph Text

You can add additional fields later; these six are the defaults the plugin expects to find.

2. Set the special_handling for Phone and Email

For each of the Phone and Email fields, open the field’s settings, switch to the Mobile App tab, and set Special Handling so the mobile app shows the right keyboard:

  • Email field → Special Handling: Email
  • Phone field → Special Handling: Phone

Without this, both fields will display the standard keyboard.

3. Set the Form Purpose

Still in Gravity Forms, open Form Settings → Mobile App Settings. Set Form Purpose to Contact Form and save.

This is the signal that tells mam-contact-form to use this Gravity Forms form instead of the built-in handler. Only one form per site should have this Form Purpose. If two forms claim Contact Form, the plugin will pick whichever Gravity Forms returns first — which is unpredictable.

4. Map the fields

Within Mobile App Settings, map each Gravity Forms field to the corresponding logical slug that the plugin expects:

Map this Gravity Forms field To this logical slug
Name name
Email email
Phone phone
Contact Reason reason
Subject subject
Description description

If you skip this mapping step, auto-population will silently no-op (the plugin matches by stored field ID) and Contact Reason routing won’t work. The mapping writes the option keys mam-contact-formcontact_form_name, mam-contact-formcontact_form_email, etc. — see Plugin: mam-contact-form for the full option list.

5. Add the form to the app

Go to Mobile App Manager → App Setup. In the navigation editor, add a new item and choose your contact form from the dropdown. Place it on either the main tab bar or the left menu, then save.

6. Configure the admin notification

Back in Forms → [your form] → Settings → Notifications, set up an admin notification with the email address that should receive submissions. Use the standard Gravity Forms notification UI.

If you plan to route different Contact Reasons to different addresses, create one notification per reason and continue with Recipe: Enabling multiple contact reason types.


Verification

To confirm everything is wired up:

  1. Open the mobile app and tap the contact form entry. The form should render with all six fields.
  2. If you’re signed in and your user profile has a name, email, or phone, those fields should be auto-populated.
  3. Submit the form with test data.
  4. Check the email inbox for the admin notification.
  5. In WP Admin, go to Forms → [your form] → Entries and confirm the entry is there with the submitted values.

If any step fails:

  • The form renders empty → check Form Purpose is set to Contact Form on exactly one form.
  • Auto-populated fields are blank → check Field Mapping (step 4); the option keys must point at the correct GF field IDs.
  • Email not delivered → check Gravity Forms’s own notification log first; the plugin delegates email dispatch through the standard GF notification system.

What to do next

  • To add custom fields beyond the default six, you can either add them in the Gravity Forms editor (recommended on this path) or use the mam_gf_get_form_settings_fields_contact_form filter — see Hook: mam_gf_get_form_settings_fields_contact_form.
  • To route different submissions to different notifications, see Recipe: Enabling multiple contact reason types.
  • To run custom code after a submission, see Hook: mam_contact_form_contact_processed.

Switching back to the default path

If you decide later to use the built-in handler instead, clear the Form Purpose on the Gravity Forms form (or delete the form). The plugin will fall back to the built-in default form. Existing Gravity Forms entries are preserved; new submissions will route through the built-in handler.

The mapped option keys (mam-contact-formcontact_form_name, etc.) are not cleared automatically. They’re harmless on the default path, but if you re-build a different Gravity Forms form later, delete and re-map them rather than reusing stale field IDs.


  • Plugin: mam-contact-form
  • Recipe: Setting up a contact form (default path)
  • Recipe: Enabling multiple contact reason types
  • Hook: mam_gf_get_form_settings_fields_contact_form
  • Hook: mam_contact_form_populate_contact
  • Hook: mam_contact_form_contact_processed

Metadata

Field Value
Article type Recipe (Admin)
Plugin slug mam-contact-form
Applies to plugin version 2.1+
Category Building Your App
Audience WordPress admin
Estimated time 15 minutes
Applies to setup paths Gravity Forms path
Last verified 2026-05-01
Contents

    Need Support?

    Can’t find the answer you’re looking for? Don’t worry we’re here to help!