Email Tokens 關(guān)于消息的預(yù)設(shè)內(nèi)容編輯

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版本的更新柿究,消息內(nèi)容已經(jīng)很容易編輯了承二。尤其當(dāng)一條單獨(dú)的消息被指定發(fā)出去的時(shí)候薄风,通知已經(jīng)變得很雞肋了。

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.

我們還是預(yù)設(shè)了一些常用的通知內(nèi)容,比如包含接收消息人的名字秕衙,被寫為{{recipient.username}}止状,如果發(fā)送消息的環(huán)境不同,那么發(fā)送的消息必須有針對(duì)性才有意義慷蠕,每一條消息也都會(huì)發(fā)給更多指定的用戶。舉個(gè)例子食呻,當(dāng)一個(gè)用戶被邀請(qǐng)加入一個(gè)小組流炕,那么他會(huì)受到一條邀請(qǐng)的消息。這些消息還包括允許你加入的小組名字和發(fā)送邀請(qǐng)給你的小組成員的資料仅胞,并且有鏈接直接點(diǎn)擊進(jìn)入管理妮的邀請(qǐng)界面每辟。這些預(yù)設(shè)的消息內(nèi)容我在下面都列出來了。

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.

最后干旧,還有一些預(yù)設(shè)內(nèi)容被作為兩組放在兩個(gè)大括號(hào)里渠欺,像{{site.description}},還有些是三組椎眯,比如{{{site.url}挠将。三組的跟兩組會(huì)有些不同(但依舊是一個(gè)整體),用以表示關(guān)鍵的有效鏈接盅视。所以捐名,請(qǐng)注意各個(gè)預(yù)設(shè)內(nèi)容之間的邏輯關(guān)系以保持可行性。

Global tokens available in all messages

以下這些內(nèi)容各個(gè)環(huán)境下都通用闹击。

{{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: ‘a(chǎn)n administrator’ or ‘a(chǎn) 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/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末镶蹋,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子赏半,更是在濱河造成了極大的恐慌贺归,老刑警劉巖,帶你破解...
    沈念sama閱讀 211,123評(píng)論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件断箫,死亡現(xiàn)場離奇詭異拂酣,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)仲义,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,031評(píng)論 2 384
  • 文/潘曉璐 我一進(jìn)店門婶熬,熙熙樓的掌柜王于貴愁眉苦臉地迎上來剑勾,“玉大人,你說我怎么就攤上這事赵颅∷淞恚” “怎么了?”我有些...
    開封第一講書人閱讀 156,723評(píng)論 0 345
  • 文/不壞的土叔 我叫張陵饺谬,是天一觀的道長捂刺。 經(jīng)常有香客問我,道長募寨,這世上最難降的妖魔是什么族展? 我笑而不...
    開封第一講書人閱讀 56,357評(píng)論 1 283
  • 正文 為了忘掉前任,我火速辦了婚禮拔鹰,結(jié)果婚禮上仪缸,老公的妹妹穿的比我還像新娘。我一直安慰自己格郁,他們只是感情好腹殿,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,412評(píng)論 5 384
  • 文/花漫 我一把揭開白布独悴。 她就那樣靜靜地躺著例书,像睡著了一般。 火紅的嫁衣襯著肌膚如雪刻炒。 梳的紋絲不亂的頭發(fā)上决采,一...
    開封第一講書人閱讀 49,760評(píng)論 1 289
  • 那天,我揣著相機(jī)與錄音坟奥,去河邊找鬼树瞭。 笑死,一個(gè)胖子當(dāng)著我的面吹牛爱谁,可吹牛的內(nèi)容都是我干的晒喷。 我是一名探鬼主播,決...
    沈念sama閱讀 38,904評(píng)論 3 405
  • 文/蒼蘭香墨 我猛地睜開眼访敌,長吁一口氣:“原來是場噩夢啊……” “哼凉敲!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起寺旺,我...
    開封第一講書人閱讀 37,672評(píng)論 0 266
  • 序言:老撾萬榮一對(duì)情侶失蹤爷抓,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后阻塑,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體蓝撇,經(jīng)...
    沈念sama閱讀 44,118評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,456評(píng)論 2 325
  • 正文 我和宋清朗相戀三年陈莽,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了渤昌。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片虽抄。...
    茶點(diǎn)故事閱讀 38,599評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖独柑,靈堂內(nèi)的尸體忽然破棺而出极颓,到底是詐尸還是另有隱情,我是刑警寧澤群嗤,帶...
    沈念sama閱讀 34,264評(píng)論 4 328
  • 正文 年R本政府宣布菠隆,位于F島的核電站,受9級(jí)特大地震影響狂秘,放射性物質(zhì)發(fā)生泄漏骇径。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,857評(píng)論 3 312
  • 文/蒙蒙 一者春、第九天 我趴在偏房一處隱蔽的房頂上張望破衔。 院中可真熱鬧,春花似錦钱烟、人聲如沸晰筛。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,731評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽读第。三九已至,卻和暖如春拥刻,著一層夾襖步出監(jiān)牢的瞬間怜瞒,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,956評(píng)論 1 264
  • 我被黑心中介騙來泰國打工般哼, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留吴汪,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 46,286評(píng)論 2 360
  • 正文 我出身青樓蒸眠,卻偏偏與公主長得像漾橙,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子楞卡,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,465評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容