<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][13853] trunk/docs/user/administration/emails/tokens.md: Documentation: migrate the codex page about BuddyPress Email tokens</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/13853">13853</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/13853","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-05-06 17:56:56 +0000 (Mon, 06 May 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Documentation: migrate the codex page about BuddyPress Email tokens
Closes https://github.com/buddypress/buddypress/pull/286</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdocsuseradministrationemailstokensmd">trunk/docs/user/administration/emails/tokens.md</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdocsuseradministrationemailstokensmd"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/docs/user/administration/emails/tokens.md</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/docs/user/administration/emails/tokens.md 2024-05-05 11:24:23 UTC (rev 13852)
+++ trunk/docs/user/administration/emails/tokens.md 2024-05-06 17:56:56 UTC (rev 13853)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,3 +1,269 @@
</span><span class="cx" style="display: block; padding: 0 10px"> # BuddyPress Email Tokens
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-TBD
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+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.
+
+## Global tokens available for all BuddyPress Email situations
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{site.admin-email}}` | Email address of the site administrator |
+| `{{{site.url}}}` | Your WordPress site’s landing page (value of `home_url()`) |
+| `{{site.description}}` | Your WordPress site’s tagline (value of `get_bloginfo( 'description' )`) |
+| `{{site.name}}` | Your WordPress site’s title (value of `get_bloginfo( 'name' )`) |
+| `{{recipient.email}}` | Email address of recipient |
+| `{{recipient.name}}` | Display name of recipient |
+| `{{recipient.username}}` | Username (login) of recipient |
+| `{{{unsubscribe}}}` | Link to the recipient’s email notifications settings screen in their user profile |
+| `{{email.subject}}` | The subject line of the email |
+
+## Tokens specific to a BuddyPress Email situation
+
+### Core situations
+
+#### Recipient has registered for an account.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{{activate.url}}}` | Link to the site’s membership activation page, including the user’s activation key |
+| `{{key}}` | Activation key |
+| `{{user.email}}` | The new user’s email address |
+| `{{user.id}}` | The new user’s ID |
+
+#### Recipient has registered for an account and site.
+
+> [!NOTE]
+> This situation is only available & used in WordPress Multisite configs.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{{activate-site.url}}}` | Link to the site’s membership and new blog activation page |
+| `{{{user-site.url}}}` | The link to the new blog created by the user |
+| `{{title}}` | The new blog’s title |
+| `{{domain}}` | The new blog’s domain |
+| `{{path}}` | The new blog’s path |
+| `{{key_blog}}` | Activation key |
+
+#### Recipient has successfully activated an account.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{displayname}}` | Display name of the user |
+| `{{{profile.url}}}` | Link to the recipient’s user profile |
+| `{{{lostpassword.url}}}` | Link to the WordPress login screen to reset recipient's password |
+
+### Members situations
+
+#### A site member has sent a site invitation to the recipient.
+
+> [!NOTE]
+> This situation is only used if the option to let members to send invitations to join a site is active.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{inviter.name}}` | The name of the user who sent the invitations to join the site (wrapped in a link to that user’s profile) |
+| `{{{inviter.url}}}` | The link to the profile page of the user who sent the invitations to join the site |
+| `{{inviter.id}}` | The ID of the user who sent the invitations to join the site |
+| `{{{invite.accept_url}}}` | The URL to use to accept the invitation |
+| `{{usermessage}}` | The invitation text |
+
+#### Someone has requested membership on this site.
+
+> [!NOTE]
+> This situation is only used if the option to request site membership is active.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{admin.id}}`| The ID of the admin user to inform about this new site membership request |
+| `{{{manage.url}}}` | The URL to use to manage site membership requests |
+| `{{requesting-user.user_login}}` | The login name of the user who sent the membership request |
+
+#### A site membership request has been rejected.
+
+> [!NOTE]
+> This situation is only used if the option to request site membership is active.
+> This situation do not use specific tokens.
+
+### Activity situations
+
+> [!NOTE]
+> The following situations are only used if Activity component is active.
+
+#### A member has replied to an activity update that the recipient posted.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{usermessage}}` | The content of the Activity comment |
+| `{{poster.name}}` | Display name of Activity comment author |
+| `{{{thread.url}}}` | Permalink to the original activity item thread |
+| `{{comment.id}}` | The Activity comment ID |
+| `{{commenter.id}}` | The ID of the user who posted the Activity comment. |
+| `{{original_activity.user_id}}` | The ID of the user who wrote the original activity update |
+
+#### A member has replied to a comment on an activity update that the recipient posted.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{usermessage}}` | The content of the Activity comment reply |
+| `{{poster.name}}` | Display name of Activity comment reply author |
+| `{{{thread.url}}}` | Permalink to the original activity item thread |
+| `{{comment.id}}` | The Activity comment reply ID |
+| `{{parent-comment-user.id}}` | The ID of the user who wrote the immediate parent Activity comment |
+| `{{commenter.id}}` | The ID of the user who posted the Activity comment reply |
+
+#### Recipient was mentioned in an activity update.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{usermessage}}` | The content of the activity update |
+| `{{{mentioned.url}}}` | Permalink to the activity item |
+| `{{poster.name}}` | Display name of activity item author |
+| `{{receiver-user.id}}` | The ID of the user who was mentioned in the update |
+
+#### Recipient was mentioned in a group activity update.
+
+> [!NOTE]
+> This situation is only used if Groups component is active.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{usermessage}}` | The content of the activity update |
+| `{{{mentioned.url}}}` | Permalink to the activity item |
+| `{{poster.name}}` | Display name of activity item author |
+| `{{receiver-user.id}}` | The ID of the user who was mentioned in the update |
+| `{{group.name}}` | Name of the group housing the activity update |
+
+### Friends situations
+
+> [!NOTE]
+> The following situations are only used if Friends component is active.
+
+#### A member has sent a friend request to the recipient.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{{friend-requests.url}}}` | The URL to the user’s friendship request management screen |
+| `{{{initiator.url}}}` | The URL of the initiator’s user profile |
+| `{{initiator.name}}` | Display name of the friendship initiator |
+| `{{friendship.id}}` | ID of the friendship object |
+| `{{friend.id}}` | User ID of the friendship request recipient |
+| `{{initiator.id}}` | User ID of the user who initiated the friendship request |
+
+#### Recipient has had a friend request accepted by a member.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{{friendship.url}}}` | The URL to the user’s friendship request management screen |
+| `{{friend.name}}` | Display name of the friendship request recipient |
+| `{{friendship.id}}` | ID of the friendship object |
+| `{{friend.id}}` | User ID of the friendship request recipient |
+| `{{initiator.id}}` | User ID of the user who initiated the request |
+
+### Groups situations
+
+> [!NOTE]
+> The following situations are only used if Groups component is active.
+
+#### A group’s details were updated.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{changed_text}}` | Text describing the details of the change |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{group.name}}` | The name of the group |
+| `{{group.id}}` | The ID of the group |
+
+#### A member has sent a group invitation to the recipient.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{inviter.name}}` | Group Inviter’s display name wrapped in a link to that user’s profile |
+| `{{{inviter.url}}}` | The URL of the profile of the user who extended the invitation |
+| `{{{invites.url}}}` | The URL of the recipient’s group invitations management screen |
+
+#### A member has requested permission to join a group.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group-requests.url}}}` | The URL of the group’s membership requests management screen |
+| `{{requesting-user.name}}` | Display name of the user who is requesting membership |
+| `{{{profile.url}}}` | The URL of the user’s profile of the one who is requesting membership |
+| `{{admin.id}}` | User ID of the group admin who is receiving this email |
+| `{{group.id}}` | ID of the group |
+| `{{membership.id}}` | ID of the Group membership object |
+| `{{requesting-user.id}}` | ID of the user who is requesting membership |
+
+#### Recipient had requested to join a group, which was accepted.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{group.id}}` | ID of the group |
+| `{{requesting-user.id}}` | User ID of the user who is requesting membership |
+
+#### Recipient had requested to join a group, which was rejected.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{group.id}}` | ID of the group |
+| `{{requesting-user.id}}` | User ID of the user who is requesting membership |
+
+#### Recipient had requested to join a group, which was accepted by admin.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{group.id}}` | ID of the group |
+| `{{{leave-group.url}}}` | The URL of the page to leave a group |
+
+#### Recipient had requested to join a group, which was rejected by admin.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{group.id}}` | ID of the group |
+
+#### Recipient’s status within a group has changed.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{group.name}}` | The name of the group |
+| `{{{group.url}}}` | The URL of the group’s landing page |
+| `{{promoted_to}}` | The description of the new group role. Possible values: "an administrator" or "a moderator" |
+| `{{group.id}}` | ID of the group |
+| `{{user.id}}` | User ID of the promoted user |
+
+### Messages situations
+
+> [!NOTE]
+> The following situations are only used if Messages component is active.
+
+#### Recipient has received a private message.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{usersubject}}` | The subject of the message |
+| `{{usermessage}}` | The content of the message |
+| `{{{message.url}}}` | The URL of the message thread |
+| `{{sender.name}}` | Display name of the message sender |
+
+### Settings situations
+
+> [!NOTE]
+> The following situations are only used if Settings component is active.
+
+#### Recipient has changed their email address.
+
+| Tokens | Description |
+| ------ | ----------- |
+| `{{{verify.url}}}` | The URL of the page used to verify the new email address |
+| `{{displayname}}` | Display name of the recipient |
+| `{{old-user.email}}` | The user’s previous email address |
+| `{{user.email}}` | The user’s new email address |
</ins></span></pre>
</div>
</div>
</body>
</html>