What it does
Adds a predefined Event Invitations custom field for GeoDirectory event
post types. Adding it to the event CPT’s form fields gives the app’s add/edit
event form three things:
- A “Private event (only invited people can see it)” checkbox. Unchecked =
public: the event shows on the social feed for everyone in the area (the
standard feed behavior). Checked = private: the event is hidden from the
shared feed, the calendar/map/listing tables, and only invited people (plus
the creator and admins) ever see it. - An “Invite friends” checklist of the user’s BuddyPress friends (supplied
by mam-buddypress; the field is omitted when the user has no friends or no
friends provider is active). Invitees can be added to public events too —
they get a direct notification either way. - An “Invite from contacts” picker — the app’s native contacts selector
(special handling 38), the same picker the Invite Friends form uses.
On save, every new invitee receives the Event Invitation notification
(email + push, push target opens the event): replacements {event_name},
{inviter_name}, {venue_name}, {event_date}. Contacts who aren’t app
users yet are handed to mam-buddypress, which creates an invited user,
sends a friend request from the inviter (so they land in Sent Invites), and
emails them the invitation. Invitees accumulate across edits — re-saving an
event never re-notifies people already invited.
Private events appear on invitees’ feeds via the personal (never-cached) feed
source with an Invitation badge, regardless of the invitee’s geofilter
area — an invitation overrides area scoping.
Setup
- GD admin → the event CPT’s Fields panel → add Event Invitations
from Predefined Fields (works alongside Event Location; see that doc). - Configure the Event Invitation notification template under the MAM
notification settings (sluggeodirectory-event-invitation). - mam-buddypress must be active for the friends checklist and for inviting
non-user contacts; without it, only existing app users (matched by contact
email) are notified.
Hooks
mam_gd_event_invitee_friend_choices( $choices, $user_id )— supply/extend
the friends checklist (mam-buddypress provides BP friends).mam_gd_event_invite_external( $contact, $event_id, $inviter_id, $replacements )
— handle a contacts-picker row with no matching app user (mam-buddypress
implements the full app-invite pipeline).
Data
- GD detail column
event_invitations+ post metamam_event_private— the
private flag (meta is the canonical query key). - Post meta
mam_event_invitees— one row per invited user id (queryable). - Post meta
mam_event_invitee_emails,mam_event_invite_notified,
mam_event_invite_notified_ext— external emails and already-notified
bookkeeping.
Verify
- Add the field, create a public event with two invitees (one friend, one
contact who isn’t a user): both get notifications, the event shows on the
area feed for everyone. - Create a private event with one invitee: it appears on the invitee’s
and creator’s feeds (Invitation badge) but not on anyone else’s, and it is
absent from the calendar/map for non-invitees. - Re-save the private event adding a second invitee: only the new invitee is
notified.
Re-verify whenever the feed source contracts (mam_bp_feed_shared_items /
mam_bp_feed_personal_items), the notification manager message shape, or the
contacts picker (special handling 38) payload changes.
Metadata
| Field | Value |
|---|---|
| Article type | Recipe (Admin) |
| Plugin | mam-geodirectory |
| Introduced | 26.30.7 |
