Changeset 13853
- Timestamp:
- 05/06/2024 05:56:56 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/user/administration/emails/tokens.md
r13852 r13853 1 1 # BuddyPress Email Tokens 2 2 3 TBD 3 As introduced in the [BuddyPress Emails documentation page](README.md), **Tokens** are variable strings surrounded with double or triple braces that will get replaced with dynamic content when the email gets sent. When a token is surrounded with double braces (eg: `{{site.name}}`), it means the corresponding dynamic data will be escaped during the Email merge. When it's surrounded with triple braces (eg: `{{{profile.url}}}`), it means dynamic data is not escaped during the Email merge. 4 5 ## Global tokens available for all BuddyPress Email situations 6 7 | Tokens | Description | 8 | ------ | ----------- | 9 | `{{site.admin-email}}` | Email address of the site administrator | 10 | `{{{site.url}}}` | Your WordPress site’s landing page (value of `home_url()`) | 11 | `{{site.description}}` | Your WordPress site’s tagline (value of `get_bloginfo( 'description' )`) | 12 | `{{site.name}}` | Your WordPress site’s title (value of `get_bloginfo( 'name' )`) | 13 | `{{recipient.email}}` | Email address of recipient | 14 | `{{recipient.name}}` | Display name of recipient | 15 | `{{recipient.username}}` | Username (login) of recipient | 16 | `{{{unsubscribe}}}` | Link to the recipient’s email notifications settings screen in their user profile | 17 | `{{email.subject}}` | The subject line of the email | 18 19 ## Tokens specific to a BuddyPress Email situation 20 21 ### Core situations 22 23 #### Recipient has registered for an account. 24 25 | Tokens | Description | 26 | ------ | ----------- | 27 | `{{{activate.url}}}` | Link to the site’s membership activation page, including the user’s activation key | 28 | `{{key}}` | Activation key | 29 | `{{user.email}}` | The new user’s email address | 30 | `{{user.id}}` | The new user’s ID | 31 32 #### Recipient has registered for an account and site. 33 34 > [!NOTE] 35 > This situation is only available & used in WordPress Multisite configs. 36 37 | Tokens | Description | 38 | ------ | ----------- | 39 | `{{{activate-site.url}}}` | Link to the site’s membership and new blog activation page | 40 | `{{{user-site.url}}}` | The link to the new blog created by the user | 41 | `{{title}}` | The new blog’s title | 42 | `{{domain}}` | The new blog’s domain | 43 | `{{path}}` | The new blog’s path | 44 | `{{key_blog}}` | Activation key | 45 46 #### Recipient has successfully activated an account. 47 48 | Tokens | Description | 49 | ------ | ----------- | 50 | `{{displayname}}` | Display name of the user | 51 | `{{{profile.url}}}` | Link to the recipient’s user profile | 52 | `{{{lostpassword.url}}}` | Link to the WordPress login screen to reset recipient's password | 53 54 ### Members situations 55 56 #### A site member has sent a site invitation to the recipient. 57 58 > [!NOTE] 59 > This situation is only used if the option to let members to send invitations to join a site is active. 60 61 | Tokens | Description | 62 | ------ | ----------- | 63 | `{{inviter.name}}` | The name of the user who sent the invitations to join the site (wrapped in a link to that user’s profile) | 64 | `{{{inviter.url}}}` | The link to the profile page of the user who sent the invitations to join the site | 65 | `{{inviter.id}}` | The ID of the user who sent the invitations to join the site | 66 | `{{{invite.accept_url}}}` | The URL to use to accept the invitation | 67 | `{{usermessage}}` | The invitation text | 68 69 #### Someone has requested membership on this site. 70 71 > [!NOTE] 72 > This situation is only used if the option to request site membership is active. 73 74 | Tokens | Description | 75 | ------ | ----------- | 76 | `{{admin.id}}`| The ID of the admin user to inform about this new site membership request | 77 | `{{{manage.url}}}` | The URL to use to manage site membership requests | 78 | `{{requesting-user.user_login}}` | The login name of the user who sent the membership request | 79 80 #### A site membership request has been rejected. 81 82 > [!NOTE] 83 > This situation is only used if the option to request site membership is active. 84 > This situation do not use specific tokens. 85 86 ### Activity situations 87 88 > [!NOTE] 89 > The following situations are only used if Activity component is active. 90 91 #### A member has replied to an activity update that the recipient posted. 92 93 | Tokens | Description | 94 | ------ | ----------- | 95 | `{{usermessage}}` | The content of the Activity comment | 96 | `{{poster.name}}` | Display name of Activity comment author | 97 | `{{{thread.url}}}` | Permalink to the original activity item thread | 98 | `{{comment.id}}` | The Activity comment ID | 99 | `{{commenter.id}}` | The ID of the user who posted the Activity comment. | 100 | `{{original_activity.user_id}}` | The ID of the user who wrote the original activity update | 101 102 #### A member has replied to a comment on an activity update that the recipient posted. 103 104 | Tokens | Description | 105 | ------ | ----------- | 106 | `{{usermessage}}` | The content of the Activity comment reply | 107 | `{{poster.name}}` | Display name of Activity comment reply author | 108 | `{{{thread.url}}}` | Permalink to the original activity item thread | 109 | `{{comment.id}}` | The Activity comment reply ID | 110 | `{{parent-comment-user.id}}` | The ID of the user who wrote the immediate parent Activity comment | 111 | `{{commenter.id}}` | The ID of the user who posted the Activity comment reply | 112 113 #### Recipient was mentioned in an activity update. 114 115 | Tokens | Description | 116 | ------ | ----------- | 117 | `{{usermessage}}` | The content of the activity update | 118 | `{{{mentioned.url}}}` | Permalink to the activity item | 119 | `{{poster.name}}` | Display name of activity item author | 120 | `{{receiver-user.id}}` | The ID of the user who was mentioned in the update | 121 122 #### Recipient was mentioned in a group activity update. 123 124 > [!NOTE] 125 > This situation is only used if Groups component is active. 126 127 | Tokens | Description | 128 | ------ | ----------- | 129 | `{{usermessage}}` | The content of the activity update | 130 | `{{{mentioned.url}}}` | Permalink to the activity item | 131 | `{{poster.name}}` | Display name of activity item author | 132 | `{{receiver-user.id}}` | The ID of the user who was mentioned in the update | 133 | `{{group.name}}` | Name of the group housing the activity update | 134 135 ### Friends situations 136 137 > [!NOTE] 138 > The following situations are only used if Friends component is active. 139 140 #### A member has sent a friend request to the recipient. 141 142 | Tokens | Description | 143 | ------ | ----------- | 144 | `{{{friend-requests.url}}}` | The URL to the user’s friendship request management screen | 145 | `{{{initiator.url}}}` | The URL of the initiator’s user profile | 146 | `{{initiator.name}}` | Display name of the friendship initiator | 147 | `{{friendship.id}}` | ID of the friendship object | 148 | `{{friend.id}}` | User ID of the friendship request recipient | 149 | `{{initiator.id}}` | User ID of the user who initiated the friendship request | 150 151 #### Recipient has had a friend request accepted by a member. 152 153 | Tokens | Description | 154 | ------ | ----------- | 155 | `{{{friendship.url}}}` | The URL to the user’s friendship request management screen | 156 | `{{friend.name}}` | Display name of the friendship request recipient | 157 | `{{friendship.id}}` | ID of the friendship object | 158 | `{{friend.id}}` | User ID of the friendship request recipient | 159 | `{{initiator.id}}` | User ID of the user who initiated the request | 160 161 ### Groups situations 162 163 > [!NOTE] 164 > The following situations are only used if Groups component is active. 165 166 #### A group’s details were updated. 167 168 | Tokens | Description | 169 | ------ | ----------- | 170 | `{{changed_text}}` | Text describing the details of the change | 171 | `{{{group.url}}}` | The URL of the group’s landing page | 172 | `{{group.name}}` | The name of the group | 173 | `{{group.id}}` | The ID of the group | 174 175 #### A member has sent a group invitation to the recipient. 176 177 | Tokens | Description | 178 | ------ | ----------- | 179 | `{{group.name}}` | The name of the group | 180 | `{{{group.url}}}` | The URL of the group’s landing page | 181 | `{{inviter.name}}` | Group Inviter’s display name wrapped in a link to that user’s profile | 182 | `{{{inviter.url}}}` | The URL of the profile of the user who extended the invitation | 183 | `{{{invites.url}}}` | The URL of the recipient’s group invitations management screen | 184 185 #### A member has requested permission to join a group. 186 187 | Tokens | Description | 188 | ------ | ----------- | 189 | `{{group.name}}` | The name of the group | 190 | `{{{group-requests.url}}}` | The URL of the group’s membership requests management screen | 191 | `{{requesting-user.name}}` | Display name of the user who is requesting membership | 192 | `{{{profile.url}}}` | The URL of the user’s profile of the one who is requesting membership | 193 | `{{admin.id}}` | User ID of the group admin who is receiving this email | 194 | `{{group.id}}` | ID of the group | 195 | `{{membership.id}}` | ID of the Group membership object | 196 | `{{requesting-user.id}}` | ID of the user who is requesting membership | 197 198 #### Recipient had requested to join a group, which was accepted. 199 200 | Tokens | Description | 201 | ------ | ----------- | 202 | `{{group.name}}` | The name of the group | 203 | `{{{group.url}}}` | The URL of the group’s landing page | 204 | `{{group.id}}` | ID of the group | 205 | `{{requesting-user.id}}` | User ID of the user who is requesting membership | 206 207 #### Recipient had requested to join a group, which was rejected. 208 209 | Tokens | Description | 210 | ------ | ----------- | 211 | `{{group.name}}` | The name of the group | 212 | `{{{group.url}}}` | The URL of the group’s landing page | 213 | `{{group.id}}` | ID of the group | 214 | `{{requesting-user.id}}` | User ID of the user who is requesting membership | 215 216 #### Recipient had requested to join a group, which was accepted by admin. 217 218 | Tokens | Description | 219 | ------ | ----------- | 220 | `{{group.name}}` | The name of the group | 221 | `{{{group.url}}}` | The URL of the group’s landing page | 222 | `{{group.id}}` | ID of the group | 223 | `{{{leave-group.url}}}` | The URL of the page to leave a group | 224 225 #### Recipient had requested to join a group, which was rejected by admin. 226 227 | Tokens | Description | 228 | ------ | ----------- | 229 | `{{group.name}}` | The name of the group | 230 | `{{{group.url}}}` | The URL of the group’s landing page | 231 | `{{group.id}}` | ID of the group | 232 233 #### Recipient’s status within a group has changed. 234 235 | Tokens | Description | 236 | ------ | ----------- | 237 | `{{group.name}}` | The name of the group | 238 | `{{{group.url}}}` | The URL of the group’s landing page | 239 | `{{promoted_to}}` | The description of the new group role. Possible values: "an administrator" or "a moderator" | 240 | `{{group.id}}` | ID of the group | 241 | `{{user.id}}` | User ID of the promoted user | 242 243 ### Messages situations 244 245 > [!NOTE] 246 > The following situations are only used if Messages component is active. 247 248 #### Recipient has received a private message. 249 250 | Tokens | Description | 251 | ------ | ----------- | 252 | `{{usersubject}}` | The subject of the message | 253 | `{{usermessage}}` | The content of the message | 254 | `{{{message.url}}}` | The URL of the message thread | 255 | `{{sender.name}}` | Display name of the message sender | 256 257 ### Settings situations 258 259 > [!NOTE] 260 > The following situations are only used if Settings component is active. 261 262 #### Recipient has changed their email address. 263 264 | Tokens | Description | 265 | ------ | ----------- | 266 | `{{{verify.url}}}` | The URL of the page used to verify the new email address | 267 | `{{displayname}}` | Display name of the recipient | 268 | `{{old-user.email}}` | The user’s previous email address | 269 | `{{user.email}}` | The user’s new email address |
Note: See TracChangeset
for help on using the changeset viewer.