bp_email_get_type_schema( string $field = 'description' )
Get a list of emails for populating email type taxonomy terms.
Description
Parameters
- $field
-
(Optional) defaults to "description" for backwards compatibility. Other values: "all".
Default value: 'description'
Return
(array) The array of email types and their schema.
- 'description'
(string) The description of the action which causes this to trigger. - 'unsubscribe'
(array) Replacing this with false indicates that a user cannot unsubscribe from this type.- 'meta_key'
(string) The meta_key used to toggle the email setting for this notification. - 'message'
(string) The message shown when the user has successfully unsubscribed.
- 'meta_key'
Source
File: bp-core/bp-core-functions.php
function bp_email_get_type_schema( $field = 'description' ) {
$activity_comment = array(
'description' => __( 'A member has replied to an activity update that the recipient posted.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_activity_new_reply',
'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddyboss' ),
),
);
$activity_comment_author = array(
'description' => __( 'A member has replied to a comment on an activity update that the recipient posted.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_activity_new_reply',
'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddyboss' ),
),
);
$activity_at_message = array(
'description' => __( 'Recipient was mentioned in an activity update.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_activity_new_mention',
'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddyboss' ),
),
);
$groups_at_message = array(
'description' => __( 'Recipient was mentioned in a group activity update.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_activity_new_mention',
'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddyboss' ),
),
);
$core_user_registration = array(
'description' => __( 'Recipient has registered for an account.', 'buddyboss' ),
'unsubscribe' => false,
);
$core_user_registration_with_blog = array(
'description' => __( 'Recipient has registered for an account and site.', 'buddyboss' ),
'unsubscribe' => false,
);
$friends_request = array(
'description' => __( 'A member has sent an invitation to connect to the recipient.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_friends_friendship_request',
'message' => __( 'You will no longer receive emails when someone sends you an invitation to connect.', 'buddyboss' ),
),
);
$friends_request_accepted = array(
'description' => __( 'Recipient has had an invitation to connect accepted by a member.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_friends_friendship_accepted',
'message' => __( 'You will no longer receive emails when someone accepts your invitation to connect.', 'buddyboss' ),
),
);
$groups_details_updated = array(
'description' => __( "A group's details were updated.", 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_group_updated',
'message' => __( 'You will no longer receive emails when one of your groups is updated.', 'buddyboss' ),
),
);
$groups_invitation = array(
'description' => __( 'A member has sent a group invitation to the recipient.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_invite',
'message' => __( 'You will no longer receive emails when you are invited to join a group.', 'buddyboss' ),
),
);
$groups_member_promoted = array(
'description' => __( "Recipient's status within a group has changed.", 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_admin_promotion',
'message' => __( 'You will no longer receive emails when you have been promoted in a group.', 'buddyboss' ),
),
);
$groups_membership_request = array(
'description' => __( 'A member has requested permission to join a group.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_membership_request',
'message' => __( 'You will no longer receive emails when someone requests to be a member of your group.', 'buddyboss' ),
),
);
$messages_unread = array(
'description' => __( 'Recipient has received a private message.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_messages_new_message',
'message' => __( 'You will no longer receive emails when someone sends you a message.', 'buddyboss' ),
),
);
$settings_verify_email_change = array(
'description' => __( 'Recipient has changed their email address.', 'buddyboss' ),
'unsubscribe' => false,
);
$groups_membership_request_accepted = array(
'description' => __( 'Recipient had requested to join a group, which was accepted.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_membership_request_completed',
'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddyboss' ),
),
);
$groups_membership_request_rejected = array(
'description' => __( 'Recipient had requested to join a group, which was rejected.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_membership_request_completed',
'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddyboss' ),
),
);
$bbp_new_forum_topic = array(
'description' => __( 'A member has created a new forum discussion.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_bbp_new_forum_topic',
'message' => __( 'You will no longer receive emails when a member will create a new forum discussion.', 'buddyboss' ),
),
);
$bbp_new_forum_reply = array(
'description' => __( 'A member has replied to a forum discussion that the participant is following.', 'buddyboss' ),
'unsubscribe' => array(
'meta_key' => 'notification_bbp_new_forum_reply',
'message' => __( 'You will no longer receive emails when a member will reply to one of your forum discussions.', 'buddyboss' ),
),
);
$invites_member_invite = array(
'description' => __( 'Recipient has been invited by a member to join the website.', 'buddyboss' ),
'unsubscribe' => false,
);
$types = array(
'activity-comment' => $activity_comment,
'activity-comment-author' => $activity_comment_author,
'activity-at-message' => $activity_at_message,
'groups-at-message' => $groups_at_message,
'core-user-registration' => $core_user_registration,
'core-user-registration-with-blog' => $core_user_registration_with_blog,
'friends-request' => $friends_request,
'friends-request-accepted' => $friends_request_accepted,
'groups-details-updated' => $groups_details_updated,
'groups-invitation' => $groups_invitation,
'groups-member-promoted' => $groups_member_promoted,
'groups-membership-request' => $groups_membership_request,
'messages-unread' => $messages_unread,
'settings-verify-email-change' => $settings_verify_email_change,
'groups-membership-request-accepted' => $groups_membership_request_accepted,
'groups-membership-request-rejected' => $groups_membership_request_rejected,
'bbp-new-forum-topic' => $bbp_new_forum_topic,
'bbp-new-forum-reply' => $bbp_new_forum_reply,
'invites-member-invite' => $invites_member_invite,
);
if ( $field !== 'all' ) {
return wp_list_pluck( $types, $field );
} else {
return $types;
}
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.7.0 $field argument added. | BuddyPress 2.7.0 $field argument added. |
| BuddyPress 2.5.1 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.