bp_email_get_type_schema

Get a list of emails for populating email type taxonomy terms.

Description

(array) bp_email_get_type_schema( (string) $field = 'description' ); 

Returns (array)

{ The array of email types and their schema. @type string $description The description of the action which causes this to trigger. @type array $unsubscribe { Replacing this with false indicates that a user cannot unsubscribe from this type. @type string $meta_key The meta_key used to toggle the email setting for this notification. @type string $message The message shown when the user has successfully unsubscribed. }

Parameters (1)

0. $field — Optional. (string) => 'description'
Optional; defaults to description for backwards compatibility. Other values: all..

Usage

  1. if ( !function_exists( 'bp_email_get_type_schema' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-functions.php'; 
  3.  
  4. // Optional; defaults to "description" for backwards compatibility. Other values: "all". 
  5. $field = 'description'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_email_get_type_schema($field); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. function bp_email_get_type_schema( $field = 'description' ) { 
  2. $activity_comment = array( 
  3. 'description' => __( 'A member has replied to an activity update that the recipient posted.', buddypress ),  
  4. 'unsubscribe' => array( 
  5. 'meta_key' => 'notification_activity_new_reply',  
  6. 'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', buddypress ),  
  7. ),  
  8. ); 
  9.  
  10. $activity_comment_author = array( 
  11. 'description' => __( 'A member has replied to a comment on an activity update that the recipient posted.', buddypress ),  
  12. 'unsubscribe' => array( 
  13. 'meta_key' => 'notification_activity_new_reply',  
  14. 'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', buddypress ),  
  15. ),  
  16. ); 
  17.  
  18. $activity_at_message = array( 
  19. 'description' => __( 'Recipient was mentioned in an activity update.', buddypress ),  
  20. 'unsubscribe' => array( 
  21. 'meta_key' => 'notification_activity_new_mention',  
  22. 'message' => __( 'You will no longer receive emails when someone mentions you in an update.', buddypress ),  
  23. ),  
  24. ); 
  25.  
  26. $groups_at_message = array( 
  27. 'description' => __( 'Recipient was mentioned in a group activity update.', buddypress ),  
  28. 'unsubscribe' => array( 
  29. 'meta_key' => 'notification_activity_new_mention',  
  30. 'message' => __( 'You will no longer receive emails when someone mentions you in an update.', buddypress ),  
  31. ),  
  32. ); 
  33.  
  34. $core_user_registration = array( 
  35. 'description' => __( 'Recipient has registered for an account.', buddypress ),  
  36. 'unsubscribe' => false,  
  37. ); 
  38.  
  39. $core_user_registration_with_blog = array( 
  40. 'description' => __( 'Recipient has registered for an account and site.', buddypress ),  
  41. 'unsubscribe' => false,  
  42. ); 
  43.  
  44. $friends_request = array( 
  45. 'description' => __( 'A member has sent a friend request to the recipient.', buddypress ),  
  46. 'unsubscribe' => array( 
  47. 'meta_key' => 'notification_friends_friendship_request',  
  48. 'message' => __( 'You will no longer receive emails when someone sends you a friend request.', buddypress ),  
  49. ),  
  50. ); 
  51.  
  52. $friends_request_accepted = array( 
  53. 'description' => __( 'Recipient has had a friend request accepted by a member.', buddypress ),  
  54. 'unsubscribe' => array( 
  55. 'meta_key' => 'notification_friends_friendship_accepted',  
  56. 'message' => __( 'You will no longer receive emails when someone accepts your friendship request.', buddypress ),  
  57. ),  
  58. ); 
  59.  
  60. $groups_details_updated = array( 
  61. 'description' => __( "A group's details were updated.", buddypress ),  
  62. 'unsubscribe' => array( 
  63. 'meta_key' => 'notification_groups_group_updated',  
  64. 'message' => __( 'You will no longer receive emails when one of your groups is updated.', buddypress ),  
  65. ),  
  66. ); 
  67.  
  68. $groups_details_updated = array( 
  69. 'description' => __( "A group's details were updated.", buddypress ),  
  70. 'unsubscribe' => array( 
  71. 'meta_key' => 'notification_groups_group_updated',  
  72. 'message' => __( 'You will no longer receive emails when one of your groups is updated.', buddypress ),  
  73. ),  
  74. ); 
  75.  
  76. $groups_invitation = array( 
  77. 'description' => __( 'A member has sent a group invitation to the recipient.', buddypress ),  
  78. 'unsubscribe' => array( 
  79. 'meta_key' => 'notification_groups_invite',  
  80. 'message' => __( 'You will no longer receive emails when you are invited to join a group.', buddypress ),  
  81. ),  
  82. ); 
  83.  
  84. $groups_member_promoted = array( 
  85. 'description' => __( "Recipient's status within a group has changed.", buddypress ),  
  86. 'unsubscribe' => array( 
  87. 'meta_key' => 'notification_groups_admin_promotion',  
  88. 'message' => __( 'You will no longer receive emails when you have been promoted in a group.', buddypress ),  
  89. ),  
  90. ); 
  91.  
  92. $groups_member_promoted = array( 
  93. 'description' => __( "Recipient's status within a group has changed.", buddypress ),  
  94. 'unsubscribe' => array( 
  95. 'meta_key' => 'notification_groups_admin_promotion',  
  96. 'message' => __( 'You will no longer receive emails when you have been promoted in a group.', buddypress ),  
  97. ),  
  98. ); 
  99.  
  100. $groups_membership_request = array( 
  101. 'description' => __( 'A member has requested permission to join a group.', buddypress ),  
  102. 'unsubscribe' => array( 
  103. 'meta_key' => 'notification_groups_membership_request',  
  104. 'message' => __( 'You will no longer receive emails when someonerequeststo be a member of your group.', buddypress ),  
  105. ),  
  106. ); 
  107.  
  108. $messages_unread = array( 
  109. 'description' => __( 'Recipient has received a private message.', buddypress ),  
  110. 'unsubscribe' => array( 
  111. 'meta_key' => 'notification_messages_new_message',  
  112. 'message' => __( 'You will no longer receive emails when someone sends you a message.', buddypress ),  
  113. ),  
  114. ); 
  115.  
  116. $settings_verify_email_change = array( 
  117. 'description' => __( 'Recipient has changed their email address.', buddypress ),  
  118. 'unsubscribe' => false,  
  119. ); 
  120.  
  121. $groups_membership_request_accepted = array( 
  122. 'description' => __( 'Recipient had requested to join a group, which was accepted.', buddypress ),  
  123. 'unsubscribe' => array( 
  124. 'meta_key' => 'notification_membership_request_completed',  
  125. 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', buddypress ),  
  126. ),  
  127. ); 
  128.  
  129. $groups_membership_request_rejected = array( 
  130. 'description' => __( 'Recipient had requested to join a group, which was rejected.', buddypress ),  
  131. 'unsubscribe' => array( 
  132. 'meta_key' => 'notification_membership_request_completed',  
  133. 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', buddypress ),  
  134. ),  
  135. ); 
  136.  
  137. $types = array( 
  138. 'activity-comment' => $activity_comment,  
  139. 'activity-comment-author' => $activity_comment_author,  
  140. 'activity-at-message' => $activity_at_message,  
  141. 'groups-at-message' => $groups_at_message,  
  142. 'core-user-registration' => $core_user_registration,  
  143. 'core-user-registration-with-blog' => $core_user_registration_with_blog,  
  144. 'friends-request' => $friends_request,  
  145. 'friends-request-accepted' => $friends_request_accepted,  
  146. 'groups-details-updated' => $groups_details_updated,  
  147. 'groups-invitation' => $groups_invitation,  
  148. 'groups-member-promoted' => $groups_member_promoted,  
  149. 'groups-membership-request' => $groups_membership_request,  
  150. 'messages-unread' => $messages_unread,  
  151. 'settings-verify-email-change' => $settings_verify_email_change,  
  152. 'groups-membership-request-accepted' => $groups_membership_request_accepted,  
  153. 'groups-membership-request-rejected' => $groups_membership_request_rejected,  
  154. ); 
  155.  
  156. if ( $field !== 'all' ) { 
  157. return wp_list_pluck( $types, $field ); 
  158. } else { 
  159. return $types;