Add per-listing chat so users can message a venue

Goal

A signed-in app user opens a venue’s listing, taps a Chat button, and messages that venue directly. The message doesn’t land in one person’s inbox — it goes to the venue’s owner and any accepted staff/managers as a group, so whoever’s on that team can pick it up and answer.

Good news: this is a no-code task. You’ll activate the chat plugin (mam-chat-manager) on top of a directory app you already run (mam-main + mam-geodirectory), make sure the venue’s pricing package allows chat, and confirm a non-staff test user sees the Chat button on a listing. mam-geodirectory handles the wiring between the listing detail screen and chat on its own — nothing to code for the standard case.

Looking for general user-to-user or support chat that isn’t tied to a specific venue? See Recipe: Enable chat instead — this article covers only the per-listing “message this venue” button.


Before you start

Field Value
Article type How-to (Admin)
Plugins involved mam-geodirectory, mam-chat-manager, mam-main
Audience WordPress admin
Estimated time 10–15 minutes
Last verified 2026-06-01

Prerequisites:

  • WordPress admin access.
  • MAM Suite installed with mam-main activated under Mobile App Manager → Software.
  • mam-geodirectory active, with at least one published listing (a venue) and the GeoDirectory directory it depends on.
  • A MAM Suite plugin entitlement that includes mam-chat-manager.
  • At least two test app users: one acting as the venue owner/staff and one acting as an ordinary consumer. Chat is a two-party feature, so you cannot smoke-test it from a single account.

How it works (one minute of background)

You won’t touch any code for this, but knowing the rule the app follows will make the smoke test ahead feel predictable instead of mysterious.

Here’s what happens under the hood: every time a listing detail screen is built, mam-geodirectory runs a step called add_chat() that decides whether to attach a Chat button to that listing. The button shows up only when all of these are true:

  1. mam-chat-manager is active (the mam_has_chat_manager signal returns true).
  2. The listing’s pricing package has Chat With Venue enabled. If the package has it off, no Chat button — even with chat-manager active.
  3. The current viewer is not an administrator, and the listing’s author is not an administrator. Admin-to-admin chat is suppressed in the consumer app.
  4. The current viewer is not listed as staff on this venue (owners and staff don’t chat with their own venue).
  5. The current viewer is not the listing’s author.

Once those rules pass, mam-geodirectory finds — or creates, the first time it’s needed — a per-listing staff group, then hands chat-manager the listing’s payload (the bundle of listing data the app already has on hand), the viewer, the group, and the venue’s title and photo. Chat-manager hands back everything the app needs to render the Chat button and open the right thread.

Two things worth remembering:

  • No thread exists until the first message goes out. Showing the button costs nothing, and it never litters the system with empty conversations from people who never tap it.
  • Messages reach the whole venue team, not just one person. The viewer sits on one side of the conversation; the venue’s owner and accepted staff/managers sit on the other, together as a group — so any of them can pick up the reply.

Steps

1. Activate the chat plugin

First, turn the plugin on. Go to Mobile App Manager → Software. Find the Chat Manager plugin in the list, choose Install and Activate from its action dropdown, and click Apply.

Once the page reloads, check that a Chat Settings and a Chat History entry now appear in the Mobile App Manager sidebar. If they’re missing, the plugin’s entitlement check is most likely failing behind the scenes — and chat won’t show up anywhere until that check passes. (See Plugin: mam-chat-manager for how the entitlement gate works.)

There’s no separate on/off switch to flip after that — chat is simply on whenever its entitlement is present. What controls the per-listing button is the package setting you’ll set up next.

2. Enable “Chat With Venue” on the pricing package

The per-listing Chat button is gated per GeoDirectory pricing package — which means you can sell it as a paid feature. Whatever chat setting the package carries, every venue published on it inherits.

  1. Open the GeoDirectory pricing package that your test venue is on.
  2. Find the MAM-specific package fields that mam-geodirectory adds (push-notification limit, listings included, special offers included, staff slots, and chat).
  3. Enable the Chat With Venue checkbox.
  4. Save the package.

Leave Chat With Venue unchecked, and listings on that package won’t show the Chat button — no matter how active chat-manager is or how many other rules pass. This is the single most common reason the button goes missing, so check the package before you look anywhere else. See Recipe: Pricing package fields for the full field list.

If your test listing has no pricing package (package ID 0), the package gate is skipped entirely and the remaining rules decide on their own. Most production directories put every listing on a package, though, so plan on setting this per package.

3. Make sure the venue has a team to answer

The Chat button connects the viewer to the venue’s owner plus accepted staff/managers, all together as a group. For your smoke test to actually prove anything, the venue needs at least the owner — and ideally one accepted staff member too — so someone’s there to receive the message.

You add staff and managers from the Staff & Managers tools, and the chat group takes care of itself from there: newly accepted staff/managers are auto-enrolled, and anyone removed is taken back out just as automatically. You’ll never need to maintain the chat group by hand. See Recipe: Manage staff and managers (admin) and Form: Add or remove staff and managers.

4. (Optional) Add a Chat tab to the app’s navigation

Per-listing chat puts the Chat button on the listing detail screen, and that’s enough to cover “message a venue” on its own. Most apps, though, also want users to reach their full conversation list from somewhere global, so they can find their way back to a thread later.

Open Mobile App Manager → App Settings for the role you’re configuring, and add a Chat tab-bar button (or a Standard Chat entry in the left menu / home screen). This is the standard thread list, not the per-listing button — think of them as two doors into the same room. See Recipe: Enable chat for placement details.

5. Smoke-test as a consumer

Now try it yourself. Sign in to the mobile app as your consumer test user (not the venue owner, not staff, not an admin):

  1. Open the venue’s listing detail screen.
  2. Confirm a Chat button appears on the detail.
  3. Tap it and send a test message to the venue.

Next, sign in as the venue owner or staff user on a second device or session:

  1. Open the Chat thread list (the global Chat tab from step 4, or Chat History in wp-admin to confirm the thread exists).
  2. Confirm the message from the consumer arrived in a thread scoped to that venue.
  3. Reply, and confirm the consumer receives it.

Don’t worry if the unread badge doesn’t update right away — it catches up on the next phone-data refresh, whether that’s a pull-to-refresh or just backgrounding and reopening the app.


Troubleshooting

The Chat button doesn’t appear on the listing. Walk down the five rules in order — the culprit is almost always one of these:

  • Package: Is Chat With Venue enabled on the listing’s pricing package? This is by far the most common cause.
  • Chat plugin: Is mam-chat-manager active, with Chat Settings / Chat History showing in the sidebar? If not, the entitlement check is failing.
  • You’re testing as the wrong user: The button is intentionally hidden from administrators, from the listing’s author, and from anyone who is staff on that listing. Make sure you’re testing as a plain consumer account.
  • No team to message: If the venue has no owner/staff on the chat side, there’s no one to message. Confirm the venue has at least an owner.

The button appears, but tapping it does nothing, or opens an empty header. The display name and photo you see come from the venue’s title and listing image. No image on the listing? The app falls back to an initials avatar — that’s expected behavior, not a bug. If the thread refuses to open at all, confirm the listing has a valid author and at least one resolvable participant on the venue side.

A staff member sees the Chat button on their own venue. They shouldn’t — owners and staff are excluded by design. That exclusion depends entirely on the mam_staff_<listing_id> user-meta flag for that person; if the button’s showing anyway, the flag is likely missing or empty for their account on this listing. Confirm their staff record for this listing was actually written.

Messages reach only one person. That’s not how venue chat is meant to work — by design, the message goes out to the venue’s whole staff group, so any accepted team member can pick it up. If only the owner ever receives anything, the venue probably has no accepted staff yet.


Going further (developer)

The standard GeoDirectory path never needs code. But say you’re building a different kind of detail screen — a WooCommerce product, a custom CPT, a service — and want that same “Message” button. Your detail-screen builder can hook into the same chat-manager seam directly:

$data_array = apply_filters(
    'mam_add_chat_to_detail',
    $data_array,
    [
        'post_id'   => $listing_post_id,
        'user_ids'  => [ get_current_user_id() ], // the viewer
        'group_ids' => [ $staff_group_id ],       // the venue's team
        'chat_name' => $venue_title,
        'to_avatar' => $venue_image_url,
    ]
);

This is exactly what mam-geodirectory‘s add_chat() does internally, just spelled out. Pass WP user IDs, not app_user IDs — chat-manager resolves the rest and builds a deterministic conversation token without creating a thread yet. See Hook: mam_add_chat_to_detail for the full parameter and return contract, and Integration: Chat Manager for how mam-geodirectory drives it.


Verification

This article was last verified against:

  • Plugin: mam-geodirectory v2.1.5+ — content-classes/local-app-geodirectory-v2-class.php (add_chat())
  • Plugin: mam-chat-manager v2.0.0+ — includes/mam_chat_manager_end_points.php (mam_add_chat_to_detail())
  • mam-main (required) — provides the entitlement gate and detail-screen pipeline
  • Reference: Integration: Chat Manager (mam-geodirectory/user_docs/05c-integration-chat-manager.md)
  • Reference: Recipe: Pricing package fields (chat_with_venue)

Re-verify whenever the chat group key ('listing_staff') changes, the package gate (chat_with_venue) is renamed, the five add_chat() rules change, or the mam_add_chat_to_detail contract changes.


  • Recipe: Enable chat — turn on the global Chat tab and thread list
  • Integration: Chat Manager — how mam-geodirectory wires per-listing chat
  • Recipe: Pricing package fields — the Chat With Venue package setting
  • Recipe: Manage staff and managers (admin) — who answers on the venue side
  • Plugin: mam-chat-manager — data model, surfaces, and hooks
  • Hook: mam_add_chat_to_detail — wire a Message button onto a custom detail screen
Was this article helpful?
Contents

    Need Support?

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