Email Tokens 关于消息的预设内容编辑

With the release of BuddyPress 2.5.0, site administrators can easily edit the contents of email notifications. These notifications use “tokens,” which are generic placeholders that are replaced with specific data when a single message is generated and sent.

随着BuddyPress 2.5.0版本的更新,消息内容已经很容易编辑了。尤其当一条单独的消息被指定发出去的时候,通知已经变得很鸡肋了。

We’ve created some general-purpose tokens that are available for use in any message, like the display name of the recipient (tokenized as{{recipient.username}}). Because messages sent in different contexts need different information to be meaningful, each message also has access to more specific tokens. Take the message sent when a member is invited to a group, for instance. It includes tokens that allow you to include the group’s name, the display name and member profile of the member who extended the invitation, and a link to the recipient’s “manage invitations” screen. The tokens available in each specific message are listed below.

我们还是预设了一些常用的通知内容,比如包含接收消息人的名字,被写为{{recipient.username}},如果发送消息的环境不同,那么发送的消息必须有针对性才有意义,每一条消息也都会发给更多指定的用户。举个例子,当一个用户被邀请加入一个小组,那么他会受到一条邀请的消息。这些消息还包括允许你加入的小组名字和发送邀请给你的小组成员的资料,并且有链接直接点击进入管理妮的邀请界面。这些预设的消息内容我在下面都列出来了。

Finally, some tokens are wrapped in two sets of curly braces, like{{site.description}}, while other are wrapped in three sets, like{{{site.url}}}. Tokens wrapped in three braces are treated differently (they are not escaped on merging) which is critical for including working links, for instance. So, keep track of how many braces the token you’re including needs to work properly.

最后,还有一些预设内容被作为两组放在两个大括号里,像{{site.description}},还有些是三组,比如{{{site.url}。三组的跟两组会有些不同(但依旧是一个整体),用以表示关键的有效链接。所以,请注意各个预设内容之间的逻辑关系以保持可行性。

Global tokens available in all messages

以下这些内容各个环境下都通用。

{{site.admin-email}}Email address of the site administrator.

{{{site.url}}}Value ofhome_url().

{{site.description}}Value of ‘blog description’.

{{site.name}}Value of ‘blog 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 his or her user profile.

Activity

[{{{site.name}}}] {{poster.name}} mentioned you in a status update

Situation: Recipient was mentioned in an activity update.

{{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 is receiving the update.

[{{{site.name}}}] {{poster.name}} mentioned you in an update

Situation: Recipient was mentioned in agroupactivity update.

{{usermessage}}The content of the activity update.

{{{mentioned.url}}}Permalink to the activity item.

{{poster.name}}Display name of activity item author.

{{group.name}}Name of the group housing the activity update. Empty if not in a group.

{{receiver-user.id}}The ID of the user who is receiving the update.

[{{{site.name}}}] {{poster.name}} replied to one of your updates

Situation: A member has replied to an activity update that the recipient posted.

{{usermessage}}The content of the comment.

{{poster.name}}Display name of comment author.

{{{thread.url}}}Permalink to the original activity item thread.

{{comment.id}}The comment ID.

{{commenter.id}}The ID of the user who posted the comment.

{{original_activity.user_id}}The ID of the user who wrote the original activity update.

[{{{site.name}}}] {{poster.name}} replied to one of your comments

Situation: A member has replied to a comment on an activity update that the recipient posted.

{{usermessage}}The content of the comment.

{{poster.name}}Display name of comment author.

{{{thread.url}}}Permalink to the original activity item thread.

{{comment.id}}The comment ID.

{{parent-comment-user.id}}The ID of the user who wrote the immediate parent comment.

{{commenter.id}}The ID of the user who posted the comment.

Members

[{{{site.name}}}] Activate {{{user-site.url}}}

Situation: Recipient has registered for an account and site.

{{{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}}The activation key created in wpmu_signup_blog().

{{user.email}}The new user’s email address. (Dupes recipient.email?)

[{{{site.name}}}] Activate your account

Situation: Recipient has registered for an account.

{{{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. (Dupes recipient.email?)

{{user.id}}The new user’s ID.

[{{{site.name}}}] New friendship request from {{initiator.name}}

Situation: A member has sent a friend request to the recipient.

{{{friend-requests.url}}}Link to the user’s friendship request management screen.

{{{initiator.url}}}The initiator’s user profile.

{{initiator.name}}Display name of the initiator.

{{friendship.id}}ID of the friendship object.

{{friend.id}}ID of the request recipient.

{{initiator.id}}ID of the user who initiated the request.

[{{{site.name}}}] {{friend.name}} accepted your friendship request

Situation: Recipient has had a friend request accepted by a member.

{{{friendship.url}}}Link to the request recipient’s user profile.

{{friend.name}}Display name of the request recipient.

{{friendship.id}}ID of the friendship object.

{{friend.id}}ID of the request recipient.

{{initiator.id}}ID of the user who initiated the request.

[{{{site.name}}}] Verify your new email address

Situation: Recipient has changed their email address.

{{{verify.url}}}Link used to verify the new email address.

{{displayname}}Display name of recipient (Dupes recipient.name?)

{{old-user.email}}The user’s previous email address.

{{user.email}}The user’s new email address.

Private Messages

{{{site.name}}}] New message from {{sender.name}}

Situation: Recipient has received a private message.

{{usersubject}}The subject of the message.

{{usermessage}}The content of the message.

{{{message.url}}}Link to the message thread.

{{sender.name}}Display name of the message sender.

Groups

[{{{site.name}}}] Group details updated

Situation: A group’s details were updated.

{{changed_text}}Text describing the details of the change.

{{{group.url}}}Link to the group.

{{group.name}}Name of the group.

{{group.id}}ID of the group.

[{{{site.name}}}] Membership request for group: {{group.name}}

Situation: A member has requested permission to join a group.

{{group.name}}Name of the group.

{{{group-requests.url}}}Link to the group’s membership requests management screen.

{{requesting-user.name}}Display name of the user who is requesting membership.

{{{profile.url}}User profile of the user who is requesting membership.

{{admin.id}}ID of the group admin who is receiving this email.

{{group.id}}ID of the group.

{{membership.id}}ID of the membership object.

{{requesting-user.id}}ID of the user who is requesting membership.

Title: [{{{site.name}}}] Membership request for group “{{group.name}}” accepted

Situation: Recipient had requested to join a group, which was accepted.

{{group.name}}Name of the group.

{{{group.url}}}Link to the group.

{{group.id}}ID of the group.

{{requesting-user.id}}ID of the user who is requesting membership.

Title: [{{{site.name}}}] Membership request for group “{{group.name}}” rejected

Situation: Recipient had requested to join a group, which was rejected.

{{group.name}}Name of the group.

{{{group.url}}}Link to the group.

{{group.id}}ID of the group.

{{requesting-user.id}}ID of the user who is requesting membership.

[{{{site.name}}}] You have been promoted in the group: “{{group.name}}”

Situation: Recipient’s status within a group has changed.

{{group.name}}Name of the group.

{{{group.url}}}Link to the group.

{{promoted_to}}String describing new group responsibilitied. Possible values: ‘an administrator’ or ‘a moderator’.

{{group.id}}ID of the group.

{{user.id}}ID of the promoted user.

[{{{site.name}}}] You have an invitation to the group: “{{group.name}}”

Situation: A member has sent a group invitation to the recipient.

{{group.name}}Name of the group.

{{{group.url}}}Link to the group.

{{inviter.name}}Inviter’s display name wrapped in a link to that user’s profile.

{{{inviter.url}}}Link to the profile of the user who extended the invitation.

{{{invites.url}}}Link to the recipient’s invitation management screen.

引用自:https://codex.buddypress.org/emails/email-tokens/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,793评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,567评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,342评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,825评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,814评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,680评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,033评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,687评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,175评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,668评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,775评论 1 332
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,419评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,020评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,978评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,206评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,092评论 2 351
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,510评论 2 343

推荐阅读更多精彩内容