Summary
mam_geodirectory_manager::mam_notification_list($data_array) registers seven notification types into the MAM notification list (the array consumed by the mam-main notification editor). Each entry has a source (mam-geodirectory), a title (shown in the admin), a slug (used as message_type when the notification is dispatched), and a replacements map (placeholders the editor can use in the notification template).
This article enumerates each one and the tokens it provides.
Where it appears
- Mobile App Manager → Notifications lists the seven entries grouped under the GeoDirectory source.
- The admin defines a template for each slug (push title, push body, email subject, email body) — those templates are the only render path; the plugin does not produce text itself.
- At runtime, the slugs are dispatched via
do_action('mam_notification_send_message', $message)from the form handlers and admin tools that triggered them.
The seven types
geodirectory-request-to-add
Fires when a new listing is submitted (typically by an app user via the Add/Edit Listing form when “Add in Draft” is enabled). No replacements.
geodirectory-request-to-add-event
Fires when a new event is submitted. Replacements:
{title}— event title.{url}— event URL.
geodirectory-pending-reservation-tomorrow
Reservation reminder for a booking that starts tomorrow. Replacements:
{location_name}{location_address}{start_date}{end_date}
Heads up: the PLUGIN_AUDIT.md flagged a typo in this entry — the audit claimed the replacement was misnamed
start_datemapped from a wrong source key. The current source code uses'start_date' => 'start_date', which is consistent with the otherreplacementsentries in this method (each maps a token name to itself, then expects the dispatcher to fill it). If you observe the placeholder not being substituted, check that the dispatcher sets the matching key.
geodirectory-pending-reservation-today
Reservation reminder for today. Same replacement set as -tomorrow.
geodirectory-claim-listing-invitation
Sent by the Claim Listings admin tool. Replacements:
{code}— the unique client code generated for the listing.{venue_name}— the listing’s title.
geodirectory-staff-invitation
Sent by the Add/Edit Staff form when a manager or staff member is invited to a listing. Replacements:
{code},{venue_name}(inherited from the prior section’s$replacementsarray — see below){listing_name}— the listing’s title.{listing_invite_by}— full name of the person sending the invite.{invite_name}— first/last of the invitee.
geodirectory-approve-listing
Sent when an admin approves or rejects a pending listing via the Approve Listing form. Replacements:
{title}— listing title.{note}— admin’s explanatory note.{status}—'Approved'or'Rejected'.
Implementation note about $replacements reuse
The method reuses the $replacements variable across notification entries. The staff invitation block extends the replacements for the claim-invitation block (code and venue_name from the previous block, plus the staff-specific keys). The approve-listing block resets $replacements to a fresh array.
If you add a new notification slug here, copy the pattern and reset the array explicitly rather than relying on the previous block’s leftovers — otherwise placeholders from the prior block will silently appear in your template.
How to add a new GeoDirectory notification
- Hook
mam_notification_listat a higher priority than this plugin’s default. - Append your entry with
source: 'mam-geodirectory'(or your own slug), atitle, aslug, and areplacementsmap. - Build a template for it under Mobile App Manager → Notifications.
- Dispatch via
do_action('mam_notification_send_message', $message), ensuring$message['message_type']matches your slug and$message['replacements']populates the keys.
Common recipes
- Suppress one of the built-in notifications. Hook
mam_notification_listat lower priority and unset the entry byslug. - Add a token. You cannot mutate an existing entry’s
replacementsarray from outside without hooking later in the chain. Hookmam_notification_listat lower priority and merge your token into the matching entry. - Localise the title. The titles are not currently translatable (the strings are passed without
__()inmam_notification_list). To localise, hook the filter and replace the entries with translated copies.
Verification
This article was last verified against:
- Plugin:
mam-geodirectoryv2.1.5 - Source:
mam-geodirectory.php—mam_notification_list()
Re-verify whenever a notification slug is added/removed/renamed, the replacements arrays change shape, or the $replacements reuse pattern is refactored to use explicit resets per block.
Related articles
- Plugin: mam-geodirectory
- Form: Send Notification
- Form: Add or remove staff and managers
- Form: Approve Listing
- Form and flow: Claim Listing
- Recipe: Bulk-invite venue owners
Metadata
| Field | Value |
|---|---|
| Article type | JSON Key Reference |
| Plugin slug | mam-geodirectory |
| Applies to plugin version | 2.1.5+ |
| Category | App Settings Reference |
| Audience | WordPress admin |
| Last verified | 2026-05-01 |
