🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Self-Hosted Chat Premium Add-on Setup Guide

Updated 7 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. Step 1: install and connect
  4. Connecting each server
  5. The other settings
  6. Step 2: add a feed to a form
  7. Writing the message
  8. How posting works
  9. The result on the entry
  10. Merge tags and notifications
  11. Daily cap, bulk actions and the connection check
  12. For developers
  13. Privacy
  14. Frequently asked questions

Video walkthrough

Gravity Forms Self-Hosted Chat Add-On Setup Guide: Mattermost, Rocket.Chat & Zulip (WordPress Side)
Video setup guide: Gravity Forms Self-Hosted Chat Watch on YouTube

The Gravity Forms Self-Hosted Chat Premium Add-on posts a message to your own team chat server when a Gravity Forms form is submitted. It works with Mattermost, Rocket.Chat and Zulip that you host yourself. A feed decides where the message goes (a channel or a stream), what it says (with merge tags) and when it is posted (conditional logic). The message is posted in the background, so the visitor never waits, and the result is written to the entry. Nothing is sent to any third-party chat service: the message only ever goes to the base URL you control.

What you need

  • WordPress 5.8 or newer, PHP 7.4 or newer and Gravity Forms 2.5 or newer. Tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.
  • Your own Mattermost, Rocket.Chat or Zulip server, reachable over HTTPS at a host you control, for example chat.your-company.org.
  • Either an incoming webhook (the simplest: your server gives you a webhook path) or a bot token for the server’s REST API. Rocket.Chat and Zulip also need the matching user id or bot e-mail.
  • Your GravityExtra licence key. Without an active licence nothing is posted and the entry gets a note that says so.

Because every server you connect to is one you run yourself, your messages, your channels and your logs stay on your own infrastructure. The add-on never contacts a hosted chat provider and never routes anything through GravityExtra.

Step 1: install and connect

  1. Upload and activate the add-on in Plugins.
  2. Open Forms → Settings → Self-Hosted Chat and activate your licence key.
  3. Pick your Chat server and choose How to post: an incoming webhook or the REST API.
  4. Enter the Base URL (just the host, for example chat.your-company.org), then either the webhook path or the bot token (and the user id or bot e-mail), and press Save.
  5. Press Check the connection. The add-on asks your server a read-only question with the saved base URL and credentials. It posts nothing.
The Self-Hosted Chat settings screen in Gravity Forms: the licence box, the chat server choice, the webhook or REST API mode, the base URL, the encrypted token, the user id or bot e-mail, the default channel and topic, the daily cap and the Check the connection button
The settings: your own server, how to post, the base URL and the token stored encrypted, and the defaults for every feed.

The token is encrypted before it is saved, with a key made from your site’s own security salts, and it is never shown again. Leave the box empty to keep the stored token, or tick Remove the stored token when saving to delete it. The add-on only ever sends to the host you saved as the base URL, so the token can never be sent anywhere else.

Connecting each server

  • Mattermost: for the webhook mode, create an incoming webhook and paste its path, for example /hooks/abc123. For the REST API mode, create a bot account, copy its access token, and use the channel id as the channel.
  • Rocket.Chat: for the webhook mode, create an incoming webhook and paste its path, for example /hooks/TOKEN. For the REST API mode, create a personal access token and enter it together with the user id, then post to a channel such as #leads.
  • Zulip: Zulip always uses its REST API. Create a bot, enter the bot’s API key as the token and the bot’s e-mail as the user, then post to a stream with an optional topic.

The other settings

  • Default channel / stream: used by feeds that do not set their own. For example website-leads. A feed can override it.
  • Default topic: Zulip only. The topic for the stream. Empty means general.
  • Posted as: webhook mode only. The display name the message is posted under, for example Website. The REST API posts as the bot.
  • Daily cap of messages: after this many messages in one day (UTC), over all feeds, the add-on stops and writes a note. Empty or 0 means no cap.

Step 2: add a feed to a form

  1. Open the form, go to Settings → Self-Hosted Chat and press Add New.
  2. Give the feed a name that says what it does, for example Website leads to Mattermost.
  3. Fill in the Channel / stream if this feed needs its own, the Topic for Zulip, and the Message.
  4. Turn on the Condition if the message is only for some entries, then save.
A Self-Hosted Chat feed: the channel or stream, the Zulip topic, the message with merge tags, the posted-as name and the condition
A feed: where the message goes, what it says and when it is posted.

Writing the message

The Message is the text posted to the channel. Use Gravity Forms merge tags to drop in answers of the form. For example, a booking form might post: New booking request from {Name:1} on the {Plan:2} plan. Email: {Email:3}. All three servers understand Markdown, so you can use bold, lists and links to make the message easy to scan in the channel. Text after 4,000 characters is cut, which is plenty for an alert.

Each feed is independent, so one form can post a short alert to one channel and a full summary to another, each with its own condition. The Channel / stream field supports merge tags too, so you can route a message to a different channel based on an answer, for example a region or a department chosen on the form.

How posting works

When an entry is saved, every feed whose condition matches is queued, and a background job posts its message to your server. The visitor only ever waits for the normal Gravity Forms confirmation; a slow or unreachable server never holds up the form and never shows an error to the visitor.

The add-on is careful never to post the same submission twice. Before the request leaves, it records that the message is being posted. If the server cannot be reached because of a temporary network problem, the job is retried later with a growing delay. If a request times out or the answer cannot be read, the message might already have arrived, so the add-on does not repeat it; instead it marks the entry as unsure and tells you the reference to look for in your chat server. You can always post again by hand from the entry list.

The result on the entry

Every post writes a note on the entry and fills a tidy box on the entry detail screen. The box shows the feed, the status, the channel the message went to and the message id the server returned (when it returns one). A failure is written as an error note with the reason, so you always know what happened without leaving WordPress.

The Self-Hosted Chat box on a Gravity Forms entry: the feed, the status posted, the channel and the message id the server returned
Every post on the entry: the feed, the status, the channel and the message id your server returned.

Merge tags and notifications

The add-on adds merge tags you can use in Gravity Forms notifications and confirmations: {chat_status} for the result (posted, fail, unsure), {chat_message_id} for the id your server returned, and {chat_channel} for the channel the message went to. Add a feed id to target one feed, for example {chat_status_3}.

It also adds two notification events on forms that have a feed, so you can e-mail your team when a post succeeds or fails:

  • Self-Hosted Chat: the message was posted
  • Self-Hosted Chat: the message could not be posted

Daily cap, bulk actions and the connection check

The daily cap stops posting after a number of messages in a day, which is a safety net while you test a new feed. In the entry list, two bulk actions let you post to a group of entries at once: one skips entries that were already posted, and one posts again. The Check the connection button on the settings screen asks your server a read-only question with the saved credentials and posts nothing, so you can confirm the base URL and token are right before you send a real submission.

For developers

A filter, gform_selfchat_message, lets you change the channel, topic, display name or message text before a feed posts, or cancel the message for one entry by returning a non-array. Two actions, gfsc_chat_sent and gfsc_chat_failed, fire after each result so you can run your own code, for example logging to another system.

Privacy

When a feed is active, the message built from the form, which can include answers of the form, is sent to the chat server you set in the add-on settings, so it can be posted in a channel. That server is one you host and control. No data is sent to any third-party chat service, and nothing is routed through GravityExtra. The add-on adds a short note to the WordPress privacy policy guide to help you describe this to your visitors.

Frequently asked questions

Does this send to a hosted chat service? No. This add-on is only for chat servers you host yourself: Mattermost, Rocket.Chat and Zulip. Nothing is sent to any third-party chat service.

Do I need a bot token? Not always. An incoming webhook is the simplest way to start with Mattermost or Rocket.Chat: you only paste the webhook path. The REST API with a bot token gives you a message id back and lets you post as the bot. Zulip uses its REST API with a bot e-mail and API key.

Can one form post to more than one channel? Yes. Add one feed per channel, each with its own message and condition. You can also route a single feed to different channels with a merge tag in the channel field.

What happens if my server is down? The form still works for the visitor. The add-on retries a temporary network failure later, and if a request may already have arrived it is not repeated. The entry note tells you exactly what happened.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr