Title: AsynCRONous bbPress Subscriptions
Author: Markus Echterhoff
Published: <strong>2015 年 3 月 11 日</strong>
Last modified: 2020 年 7 月 6 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/asyncronous-bbpress-subscriptions.svg)

# AsynCRONous bbPress Subscriptions

 作者：[Markus Echterhoff](https://profiles.wordpress.org/mechter/)

[下载](https://downloads.wordpress.org/plugin/asyncronous-bbpress-subscriptions.3.7.zip)

 * [详情](https://cn.wordpress.org/plugins/asyncronous-bbpress-subscriptions/#description)
 * [评价](https://cn.wordpress.org/plugins/asyncronous-bbpress-subscriptions/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/asyncronous-bbpress-subscriptions/#developers)

 [支持](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/)

## 描述

Per default, bbPress is sending subscription notification emails as one email with
a bunch of BCCs. There are various reasons why it would make more sense to send 
individual emails. This plugin does that, quietly in the background via WP cron,
without slowing down page load times. Also increases notification performance and
reduces database load on large sites.

Translations by @mauriciogarofalo and @mechter

#### 默认

If you don’t customize this plugin, this is what you’ll get:

 * Sends mails from `"MyBlog <admin@MyBlog.foo>"` (with your Blog’s name and admin
   email)
 * Sends mail to `"Markus <markus@example.com>"` (with the name being the user’s
   display name on the forums, not their username)
 * Subject and Message have more user friendly defaults, use the available filters(
   see below) to make them your own.

#### Customization

You can install and activate this plugin and it just works, but you have full control
over the details if you want to. Below are some filters and code snippets that help
you do what you want. If you’re new to working directly with code, please see the
example at the bottom of this page.

#### Available filters

    ```
    bbp_subscription_email_from( $from ) // $from can be a string or array('name'=>string, 'address'=>string)
    bbp_subscription_email_recipients( $recipients ) // $recipients is array of array('name'=>string, 'address'=>string)
    bbp_subscription_email_headers( $headers )
    bbp_forum_subscription_email_subject( $subject, $forum_id, $topic_id )
    bbp_forum_subscription_email_message( $message, $forum_id, $topic_id )
    bbp_topic_subscription_email_subject( $subject, $forum_id, $topic_id, $reply_id )
    bbp_topic_subscription_email_message( $message, $forum_id, $topic_id, $reply_id )

    bbp_bounce_address( $bounce_address )

    bbp_subscription_disable_async( false )
    bbp_forum_subscription_disable_async( false )
    bbp_topic_subscription_disable_async( false )
    bbp_forum_subscription_notify_author( false )
    bbp_topic_subscription_notify_author( false )
    ```

#### Helpful Snippets

Here are some pointers to get the data you might want in your notifications:

    ```
    $blog_name = get_bloginfo( 'name' );

    $forum_title = bbp_get_forum_title( $forum_id );

    $topic_author_user_id = bbp_get_topic_author_id( $topic_id );
    $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );
    $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );
    $topic_content = wp_specialchars_decode( strip_tags( bbp_get_topic_content( $topic_id ) ), ENT_QUOTES );
    $topic_url = get_permalink( $topic_id );

    $reply_author_user_id = bbp_get_reply_author_id( $reply_id );
    $reply_author_display_name = bbp_get_topic_author_display_name( $reply_id );
    $reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
    $reply_url = bbp_get_reply_url( $reply_id ); // note that it's not get_permalink()
    ```

#### 例子

To have a nice subject line for new topic notifications, add this to your theme’s`
functions.php`. If your theme does not have this file, you can simply create it 
and it will be loaded automatically. Note how the example is basically just one 
of the filters above, mixed with some of the snippets and a return statement. It’s
that simple.

    ```
    add_filter( 'bbp_forum_subscription_email_subject', function( $subject, $forum_id, $topic_id ) {
        $blog_name = get_bloginfo( 'name' );
        $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );
        $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );
        return "[$blog_name] $topic_author_display_name created a new topic: $topic_title";
    }, 10, 3); // first is priority (10 is default and just fine), second is number of arguments your filter expects
    ```

## 常见问题

### No emails are being sent

If other WP emails work normally try adding `define('ALTERNATE_WP_CRON', true);`
to your `wp-config.php`

### Can I use real cron instead of WP cron?

Yes. Add `define('DISABLE_WP_CRON', true);` to your `wp-config.php` and have a real
cron job execute e.g. `wget -q -O - http://your.blog.example.com/wp-cron.php >/dev/
null 2>&1`

## 评价

![](https://secure.gravatar.com/avatar/e15b4ae2c2fb154bc7c96bd538886081cfd4442581ed0fa376d2deab3bc2ef6d?
s=60&d=retro&r=g)

### 󠀁[Solved my Problems, great plugin!](https://wordpress.org/support/topic/solved-my-problems-great-plugin/)󠁿

 [wpturk](https://profiles.wordpress.org/wpturk/) 2019 年 2 月 12 日

Thanks for your extraordinary support!

![](https://secure.gravatar.com/avatar/078c5c148dcfcc4983cb3fce756683ce03d7aebb69f1fb9e8ea08232e4b01fea?
s=60&d=retro&r=g)

### 󠀁[Thank you, works like a charm](https://wordpress.org/support/topic/thank-you-works-like-a-charm/)󠁿

 [WP Royal](https://profiles.wordpress.org/wproyal/) 2018 年 2 月 8 日

very useful plugin.

![](https://secure.gravatar.com/avatar/9065ee4792ed72fb27c85efbac8ec09ea2ec1753fb84a1edcec520c3b980d79d?
s=60&d=retro&r=g)

### 󠀁[Fantastic plugin!](https://wordpress.org/support/topic/fantastic-plugin-777/)󠁿

 [strike3](https://profiles.wordpress.org/strike3/) 2017 年 8 月 7 日

We have a lot of users on our forum. BBPress notifications were not going out because
we were over our hosting limits for email. Among other things, this plugin forces
BBPress to send a separate email to each user (instead of one massive email that
BCCs all subscribers). We combined this with a email queue plugin, and now we are
sending out emails to hundreds of users and staying under our hosting provider’s
email limits. Woohoo!

![](https://secure.gravatar.com/avatar/a786ecf5d6a85c35d6a2e9735e52897a62481992e82d3898741095f13531756c?
s=60&d=retro&r=g)

### 󠀁[Fixed my emails](https://wordpress.org/support/topic/fixed-my-emails/)󠁿

 [rodolvertice](https://profiles.wordpress.org/rodolvertice/) 2016 年 9 月 3 日

My users weren’t getting any emails until I installed this plugin.

![](https://secure.gravatar.com/avatar/0bdbb1092d19525027eed6184a52839089b88b31d305fa3b5cb9f8118cf7c249?
s=60&d=retro&r=g)

### 󠀁[IT WORKS! •Perfect. •Simple. •Works. AND has great support!](https://wordpress.org/support/topic/it-works-perfect-simple-works-and-has-great-support/)󠁿

 [cfk4spk](https://profiles.wordpress.org/cfk4spk/) 2016 年 9 月 3 日

This plugin absolutely fixes the “issues” that bbPress created when they switched
to their bcc setup for subscribing to forums and topics! bbPress bcc idea has its
positive side, but it also has a negative side, in that it “breaks” some mailing
service systems. AsynCRONous bbPress Subscriptions FIXES that! This plugin NEEDS
to be incorporated into bbPress core! This is the way the subscriptions should work—
in the first place!! And the author’s support of this plugin could not be better!
THANK YOU, Markus!!!

![](https://secure.gravatar.com/avatar/79ce0890692f629bbd99e5f5489bb1d56848daf3a84f4755c245aa4f896221b3?
s=60&d=retro&r=g)

### 󠀁[Fixes bbPress Forum Reply Notification Emails](https://wordpress.org/support/topic/fixes-bbpress-forum-reply-notification-emails/)󠁿

 [isabel104](https://profiles.wordpress.org/isabel104/) 2016 年 9 月 3 日

By default, the bbPress forum reply notification emails were not being delivered
to any forum subscribers. This plugin fixed that, immediately. Upon installing the
plugin, the reply notification emails will just work.

 [ 阅读所有8条评价 ](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/)

## 贡献者及开发者

「AsynCRONous bbPress Subscriptions」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Markus Echterhoff ](https://profiles.wordpress.org/mechter/)

「AsynCRONous bbPress Subscriptions」插件已被翻译至 3 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/asyncronous-bbpress-subscriptions/contributors)
为本插件所做的贡献。

[帮助将「AsynCRONous bbPress Subscriptions」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/asyncronous-bbpress-subscriptions)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/asyncronous-bbpress-subscriptions/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/asyncronous-bbpress-subscriptions/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/asyncronous-bbpress-subscriptions/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/asyncronous-bbpress-subscriptions/)。

## 更新日志

#### 3.7

 * added two new filters that allow for sending notifications to post authors

#### 3.6

 * fixed bugs introduced in 3.5

#### 3.5

 * fix: in some cases email subjects contained html entities. They now contain proper
   characters.
 * code improvements

#### 3.4

 * fix: notification email subjects now correctly display special characters like
   quotation marks

#### 3.3

 * fixed Spanish translation

#### 3.2

 * added Spanish translation

#### 3.1

 * fixed German translation

#### 3.0

 * now ready to be translated at https://translate.wordpress.org/projects/wp-plugins/
   asyncronous-bbpress-subscriptions
 * added German translation

#### 2.3

 * bbp_subscription_email_from filter now accepts strings in addition to arrays

#### 2.2

 * added filters to enable synchronous sending if desired

#### 2.1

 * removed debug code

#### 2.0

 * replaced legacy bbPress code with proper implementation, major performance increase
   over bbPress default implementation
 * updated message defaults to be more user friendly
 * added filters to be backwards compatible with bbPress
 * added filters to be forwards compatible with bbPress once this plugin’s code 
   is incorporated into bbPress core

#### 1.5

 * removed filter `abbps_to`, use `abbps_recipients` instead
 * invoke `wp_specialchars_decode()` on blog name for From name

#### 1.4

 * updated code to match filter changes in bbPress 2.5.6
 * now properly injects bbPress, using the `bbp_after_setup_actions` hook

#### 1.3

 * new filter: `abbps_bounce_address` allows setting of bounce address for email
   notifications
 * minor code improvements

#### 1.2

 * changed filter: `abbps_from` to match the signature of the `abbps_to` filter (
   now passes an associative array instead of two strings).
 * removed obsolete parameters from `abbps_to` `apply_filters()` call

#### 1.1

 * changed filter: `abbps_to` has new signature `abbps_to( $to, $post_author_user_id)`
   where $to is `array( 'name' => '', 'address' => '' )`
 * new filter: `abbps_recipients` filters array of recipients just before sending
   so you can e.g. remove blacklisted emails just in time

#### 1.0

 * initial release

## 额外信息

 *  版本 **3.7**
 *  最后更新：**6 年前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 3.6 或更高版本 **
 *  已测试的最高版本为 **5.4.19**
 *  语言
 * [English (Australia)](https://en-au.wordpress.org/plugins/asyncronous-bbpress-subscriptions/)、
   [English (US)](https://wordpress.org/plugins/asyncronous-bbpress-subscriptions/)、
   [Spanish (Chile)](https://cl.wordpress.org/plugins/asyncronous-bbpress-subscriptions/)
   和 [Spanish (Spain)](https://es.wordpress.org/plugins/asyncronous-bbpress-subscriptions/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/asyncronous-bbpress-subscriptions)
 * 标签
 * [bbPress](https://cn.wordpress.org/plugins/tags/bbpress/)[cron](https://cn.wordpress.org/plugins/tags/cron/)
   [email](https://cn.wordpress.org/plugins/tags/email/)[Notifications](https://cn.wordpress.org/plugins/tags/notifications/)
   [subscription](https://cn.wordpress.org/plugins/tags/subscription/)
 *  [高级视图](https://cn.wordpress.org/plugins/asyncronous-bbpress-subscriptions/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  8 条 5 星评价     ](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/reviews/)

## 贡献者

 *   [ Markus Echterhoff ](https://profiles.wordpress.org/mechter/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/asyncronous-bbpress-subscriptions/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://www.markusechterhoff.com/donation/)