bp_email_get_type_schema( string $field = 'description' )
Get a list of emails for populating email type taxonomy terms.
Description Description
Parameters Parameters
- $field
-
(Optional) defaults to "description" for backwards compatibility. Other values: "all".
Default value: 'description'
Return 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 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.', 'buddypress' ),
'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.', 'buddypress' ),
),
);
$activity_comment_author = array(
'description' => __( 'A member has replied to a comment on an activity update that the recipient posted.', 'buddypress' ),
'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.', 'buddypress' ),
),
);
$activity_at_message = array(
'description' => __( 'Recipient was mentioned in an activity update.', 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_activity_new_mention',
'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
),
);
$groups_at_message = array(
'description' => __( 'Recipient was mentioned in a group activity update.', 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_activity_new_mention',
'message' => __( 'You will no longer receive emails when someone mentions you in an update.', 'buddypress' ),
),
);
$core_user_registration = array(
'description' => __( 'Recipient has registered for an account.', 'buddypress' ),
'unsubscribe' => false,
);
$core_user_registration_with_blog = array(
'description' => __( 'Recipient has registered for an account and site.', 'buddypress' ),
'unsubscribe' => false,
);
$friends_request = array(
'description' => __( 'A member has sent a friend request to the recipient.', 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_friends_friendship_request',
'message' => __( 'You will no longer receive emails when someone sends you a friend request.', 'buddypress' ),
),
);
$friends_request_accepted = array(
'description' => __( 'Recipient has had a friend request accepted by a member.', 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_friends_friendship_accepted',
'message' => __( 'You will no longer receive emails when someone accepts your friendship request.', 'buddypress' ),
),
);
$groups_details_updated = array(
'description' => __( "A group's details were updated.", 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_group_updated',
'message' => __( 'You will no longer receive emails when one of your groups is updated.', 'buddypress' ),
),
);
$groups_invitation = array(
'description' => __( 'A member has sent a group invitation to the recipient.', 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_invite',
'message' => __( 'You will no longer receive emails when you are invited to join a group.', 'buddypress' ),
),
);
$groups_member_promoted = array(
'description' => __( "Recipient's status within a group has changed.", 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_groups_admin_promotion',
'message' => __( 'You will no longer receive emails when you have been promoted in a group.', 'buddypress' ),
),
);
$groups_membership_request = array(
'description' => __( 'A member has requested permission to join a group.', 'buddypress' ),
'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.', 'buddypress' ),
),
);
$messages_unread = array(
'description' => __( 'Recipient has received a private message.', 'buddypress' ),
'unsubscribe' => array(
'meta_key' => 'notification_messages_new_message',
'message' => __( 'You will no longer receive emails when someone sends you a message.', 'buddypress' ),
),
);
$settings_verify_email_change = array(
'description' => __( 'Recipient has changed their email address.', 'buddypress' ),
'unsubscribe' => false,
);
$groups_membership_request_accepted = array(
'description' => __( 'Recipient had requested to join a group, which was accepted.', 'buddypress' ),
'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.', 'buddypress' ),
),
);
$groups_membership_request_rejected = array(
'description' => __( 'Recipient had requested to join a group, which was rejected.', 'buddypress' ),
'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.', 'buddypress' ),
),
);
$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,
);
if ( $field !== 'all' ) {
return wp_list_pluck( $types, $field );
} else {
return $types;
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.7.0 | $field argument added. |
| 2.5.1 | Introduced. |