BP_Groups_Invitation_Manager::run_send_action( $invitation )

This is where custom actions are added to run when notifications of an invitation or request need to be generated & sent.


Parameters Parameters

$id

(int) (Required) The ID of the invitation to mark as sent.


Top ↑

Return Return

(bool) True on success, false on failure.


Source Source

File: bp-groups/classes/class-bp-groups-invitation-manager.php

	public function run_send_action( BP_Invitation $invitation ) {
		// Notify group admins of the pending request
		if ( 'request' === $invitation->type ) {
			$admins = groups_get_group_admins( $invitation->item_id );

			foreach ( $admins as $admin ) {
				groups_notification_new_membership_request( $invitation->user_id, $admin->user_id, $invitation->item_id, $invitation->id );
			}
			return true;

		// Notify the invitee of the invitation.
		} else {
			$group = groups_get_group( $invitation->item_id );
			groups_notification_group_invites( $group, $invitation->user_id, $invitation->inviter_id );
			return true;
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.