turn off email notifictions in functions.php
-
Hi,
I’ve found some info about turning off email notifications by default for new users (here: https://buddypress.org/support/topic/how-to-disable-email-notification-to-all-newly-registered-users/) and would like to check 4 things.
The 2 code options referenced there are these, added to the child theme functions.php:
1.function bp_set_notification_default( $user_id ) { $keys = array( 'notification_activity_new_mention', 'notification_activity_new_reply', 'notification_friends_friendship_accepted', 'notification_friends_friendship_request', 'notification_groups_admin_promotion', 'notification_groups_group_updated', 'notification_groups_invite', 'notification_groups_membership_request', 'notification_messages_new_message', 'notification_messages_new_notice' ); foreach ( $keys as $key ) { update_user_meta( $user_id, $key, 'no' ); } } add_action( 'bp_core_signup_user', 'bp_set_notification_default', 100, 1 );
2.
add_action('bp_core_signup_user','bp_set_notification_default',100,1); function bp_set_notification_default($user_id) { $keys = array('notification_activity_new_mention','notification_activity_new_reply','notification_friends_friendship_accepted','notification_friends_friendship_request','notification_groups_admin_promotion','notification_groups_group_updated','notification_groups_invite','notification_groups_membership_request','notification_messages_new_message','notification_messages_new_notice'); foreach($keys as $key) { update_user_meta($user_id,$key,'no'); } }
So my questions are:
1. which code should be used?
2. Is this code still OK since the recent BP updates?
3. Does it turn off email notifications to admin for new user signups too?
4. If so, how can I keep just that functionality on?Many thanks.
- The topic ‘turn off email notifictions in functions.php’ is closed to new replies.