Applications pending on a site are approved or rejected under Users > Pending Approval, with the Approve Member(s) and Reject Member(s) bulk actions, or over MCP with the approve-applications and reject-applications abilities (see Abilities). Both paths run the same code.
What each decision does
- Approve records the organisation’s consent, gives the applicant the regular member type, drops the unclaimed role (keeping any other role, or subscriber if none), joins them to the teams on their organisation invitations (see Organisation invitations) and sends the site’s welcome email.
- Reject records the organisation’s consent as declined, closes their open organisation invitations and sends the site’s rejection email. Before 2.99.0 a rejected applicant was not told.
The abilities act only on applicants pending on the site at that moment. Anyone else (already a member, already decided, or not an applicant) is skipped and reported, so repeating a call is harmless. They need add_users on the site and take site_id, so one connector can work through any site’s queue. When called for another site, the welcome email uses that site’s own template and details.
Emails and the optional message
- Welcome email: BuddyPress’s own Account activated email (
core-user-activation), as each site has edited it. - Rejection email: “Your membership application” (
lh-membership-application-rejected), a BuddyPress email added by LH Membership. It is created on a site the first time an application there is rejected, then edited under Emails like any other. BuddyPress’s reinstall-emails tool also restores it. - Message: the abilities take an optional plain-text
message, such as a welcome note or the reason for a rejection. It goes where the email has the{{{membership.message}}}placeholder, or above the body if there is none. With no message nothing is added and the placeholder is removed. The bulk actions send the same emails without a message.
Hooks
lh_membership_make_user_member_in_backend_before_email( int $user_id ): during approval, after the member type and roles are set and before the welcome email.lh_membership_make_user_member_in_backend( int $user_id ): after an application is approved and the welcome email sent.lh_membership_decline_application_in_backend( int $user_id ): after an application is rejected.
The code is LH_Membership_onboarding_admin_class::make_user_member_in_backend() and decline_application_in_backend(), with the emails in includes/lh-membership-application-emails-class.php. (Since 2.99.0; before-email hook since 2.102.0.)