diff --git bp-groups/bp-groups-notifications.php bp-groups/bp-groups-notifications.php
index 50e27cd..12d7d81 100644
|
|
function groups_notification_new_membership_request( $requesting_user_id, $admin |
61 | 61 | if ( bp_is_active( 'notifications' ) ) { |
62 | 62 | bp_notifications_add_notification( array( |
63 | 63 | 'user_id' => $admin_id, |
64 | | 'item_id' => $requesting_user_id, |
65 | | 'secondary_item_id' => $group_id, |
| 64 | 'item_id' => $group_id, |
| 65 | 'secondary_item_id' => $requesting_user_id, |
66 | 66 | 'component_name' => buddypress()->groups->id, |
67 | 67 | 'component_action' => 'new_membership_request' |
68 | 68 | ) ); |
… |
… |
function groups_notification_new_membership_request( $requesting_user_id, $admin |
71 | 71 | if ( 'no' == bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) ) |
72 | 72 | return false; |
73 | 73 | |
| 74 | // Username of the user requesting a membership: %1$s in mail |
74 | 75 | $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id ); |
75 | 76 | $group = groups_get_group( array( 'group_id' => $group_id ) ); |
76 | 77 | |
| 78 | // Group Administrator user's data |
77 | 79 | $ud = bp_core_get_core_userdata( $admin_id ); |
78 | 80 | $group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests'; |
| 81 | |
| 82 | // Link to the user's profile who's requesting a membership: %3$s in mail |
79 | 83 | $profile_link = bp_core_get_user_domain( $requesting_user_id ); |
| 84 | |
80 | 85 | $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; |
81 | | $settings_link = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/'; |
| 86 | // Link to the group administrator email settings: %s in "disable notifications" part of the email |
| 87 | $settings_link = bp_core_get_user_domain( $admin_id ) . $settings_slug . '/notifications/'; |
82 | 88 | |
83 | 89 | // Set up and send the message |
84 | 90 | $to = $ud->user_email; |
… |
… |
function groups_format_notifications( $action, $item_id, $secondary_item_id, $to |
316 | 322 | |
317 | 323 | switch ( $action ) { |
318 | 324 | case 'new_membership_request': |
319 | | $group_id = $secondary_item_id; |
320 | | $requesting_user_id = $item_id; |
| 325 | $group_id = $item_id; |
| 326 | $requesting_user_id = $secondary_item_id; |
321 | 327 | |
322 | 328 | $group = groups_get_group( array( 'group_id' => $group_id ) ); |
323 | 329 | $group_link = bp_get_group_permalink( $group ); |