Form: Event Invitations (Private Events + Invites)

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
on the channels ticked for it under Mobile App Manager > Notifications
(nothing is ticked until you set it up; the 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

  1. GD admin → the event CPT’s Fields panel → add Event Invitations
    from Predefined Fields (works alongside Event Location; see that doc).
  2. Configure the Event Invitation notification under the MAM
    notification settings (slug geodirectory-event-invitation): tick the
    channels (Email, Push Notification, Text Message) and write the subject
    and messages. That screen is the only place that decides which channels
    go out.
  3. 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 meta mam_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

  1. 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.
  2. 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.
  3. 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
Was this article helpful?
Contents

    Need Support?

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