{"id":35048,"date":"2015-03-11T06:37:19","date_gmt":"2015-03-11T06:37:19","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/asyncronous-bbpress-subscriptions\/"},"modified":"2020-07-06T18:17:29","modified_gmt":"2020-07-06T18:17:29","slug":"asyncronous-bbpress-subscriptions","status":"publish","type":"plugin","link":"https:\/\/ewe.wordpress.org\/plugins\/asyncronous-bbpress-subscriptions\/","author":11227406,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"3.7","stable_tag":"3.7","tested":"5.4.19","requires":"3.6","requires_php":"","requires_plugins":"","header_name":"AsynCRONous bbPress Subscriptions","header_author":"Markus Echterhoff","header_description":"","assets_banners_color":"","last_updated":"2020-07-06 18:17:29","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.markusechterhoff.com\/donation\/","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/asyncronous-bbpress-subscriptions\/","header_author_uri":"https:\/\/www.markusechterhoff.com","rating":5,"author_block_rating":0,"active_installs":100,"downloads":6638,"num_ratings":8,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"8"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3","1.4","1.5","2.0","2.1","2.2","2.3","3.0","3.1","3.2","3.3","3.4","3.5","3.6","3.7"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2770,4567,267,4906,448],"plugin_category":[41,44,59],"plugin_contributors":[86859],"plugin_business_model":[],"class_list":["post-35048","plugin","type-plugin","status-publish","hentry","plugin_tags-bbpress","plugin_tags-cron","plugin_tags-email","plugin_tags-notifications","plugin_tags-subscription","plugin_category-communication","plugin_category-discussion-and-community","plugin_category-utilities-and-tools","plugin_contributors-mechter","plugin_committers-mechter"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/asyncronous-bbpress-subscriptions.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>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.<\/p>\n\n<p>Translations by @mauriciogarofalo and @mechter<\/p>\n\n<h4>Defaults<\/h4>\n\n<p>If you don't customize this plugin, this is what you'll get:<\/p>\n\n<ul>\n<li>Sends mails from <code>\"MyBlog &lt;admin@MyBlog.foo&gt;\"<\/code> (with your Blog's name and admin email)<\/li>\n<li>Sends mail to <code>\"Markus &lt;markus@example.com&gt;\"<\/code> (with the name being the user's display name on the forums, not their username)<\/li>\n<li>Subject and Message have more user friendly defaults, use the available filters (see below) to make them your own.<\/li>\n<\/ul>\n\n<h4>Customization<\/h4>\n\n<p>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.<\/p>\n\n<h4>Available filters<\/h4>\n\n<pre><code>bbp_subscription_email_from( $from ) \/\/ $from can be a string or array('name'=&gt;string, 'address'=&gt;string)\nbbp_subscription_email_recipients( $recipients ) \/\/ $recipients is array of array('name'=&gt;string, 'address'=&gt;string)\nbbp_subscription_email_headers( $headers )\nbbp_forum_subscription_email_subject( $subject, $forum_id, $topic_id )\nbbp_forum_subscription_email_message( $message, $forum_id, $topic_id )\nbbp_topic_subscription_email_subject( $subject, $forum_id, $topic_id, $reply_id )\nbbp_topic_subscription_email_message( $message, $forum_id, $topic_id, $reply_id )\n\nbbp_bounce_address( $bounce_address )\n\nbbp_subscription_disable_async( false )\nbbp_forum_subscription_disable_async( false )\nbbp_topic_subscription_disable_async( false )\nbbp_forum_subscription_notify_author( false )\nbbp_topic_subscription_notify_author( false )\n<\/code><\/pre>\n\n<h4>Helpful Snippets<\/h4>\n\n<p>Here are some pointers to get the data you might want in your notifications:<\/p>\n\n<pre><code>$blog_name = get_bloginfo( 'name' );\n\n$forum_title = bbp_get_forum_title( $forum_id );\n\n$topic_author_user_id = bbp_get_topic_author_id( $topic_id );\n$topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );\n$topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );\n$topic_content = wp_specialchars_decode( strip_tags( bbp_get_topic_content( $topic_id ) ), ENT_QUOTES );\n$topic_url = get_permalink( $topic_id );\n\n$reply_author_user_id = bbp_get_reply_author_id( $reply_id );\n$reply_author_display_name = bbp_get_topic_author_display_name( $reply_id );\n$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );\n$reply_url = bbp_get_reply_url( $reply_id ); \/\/ note that it's not get_permalink()\n<\/code><\/pre>\n\n<h4>Example<\/h4>\n\n<p>To have a nice subject line for new topic notifications, add this to your theme's <code>functions.php<\/code>. 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.<\/p>\n\n<pre><code>add_filter( 'bbp_forum_subscription_email_subject', function( $subject, $forum_id, $topic_id ) {\n    $blog_name = get_bloginfo( 'name' );\n    $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );\n    $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );\n    return \"[$blog_name] $topic_author_display_name created a new topic: $topic_title\";\n}, 10, 3); \/\/ first is priority (10 is default and just fine), second is number of arguments your filter expects\n<\/code><\/pre>\n\n<!--section=faq-->\n<dl>\n<dt><h3>No emails are being sent<\/h3><\/dt>\n<dd><p>If other WP emails work normally try adding <code>define('ALTERNATE_WP_CRON', true);<\/code> to your <code>wp-config.php<\/code><\/p><\/dd>\n<dt><h3>Can I use real cron instead of WP cron?<\/h3><\/dt>\n<dd><p>Yes. Add <code>define('DISABLE_WP_CRON', true);<\/code> to your <code>wp-config.php<\/code> and have a real cron job execute e.g. <code>wget -q -O - http:\/\/your.blog.example.com\/wp-cron.php &gt;\/dev\/null 2&gt;&amp;1<\/code><\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>3.7<\/h4>\n\n<ul>\n<li>added two new filters that allow for sending notifications to post authors<\/li>\n<\/ul>\n\n<h4>3.6<\/h4>\n\n<ul>\n<li>fixed bugs introduced in 3.5<\/li>\n<\/ul>\n\n<h4>3.5<\/h4>\n\n<ul>\n<li>fix: in some cases email subjects contained html entities. They now contain proper characters.<\/li>\n<li>code improvements<\/li>\n<\/ul>\n\n<h4>3.4<\/h4>\n\n<ul>\n<li>fix: notification email subjects now correctly display special characters like quotation marks<\/li>\n<\/ul>\n\n<h4>3.3<\/h4>\n\n<ul>\n<li>fixed Spanish translation<\/li>\n<\/ul>\n\n<h4>3.2<\/h4>\n\n<ul>\n<li>added Spanish translation<\/li>\n<\/ul>\n\n<h4>3.1<\/h4>\n\n<ul>\n<li>fixed German translation<\/li>\n<\/ul>\n\n<h4>3.0<\/h4>\n\n<ul>\n<li>now ready to be translated at https:\/\/translate.wordpress.org\/projects\/wp-plugins\/asyncronous-bbpress-subscriptions<\/li>\n<li>added German translation<\/li>\n<\/ul>\n\n<h4>2.3<\/h4>\n\n<ul>\n<li>bbp_subscription_email_from filter now accepts strings in addition to arrays<\/li>\n<\/ul>\n\n<h4>2.2<\/h4>\n\n<ul>\n<li>added filters to enable synchronous sending if desired<\/li>\n<\/ul>\n\n<h4>2.1<\/h4>\n\n<ul>\n<li>removed debug code<\/li>\n<\/ul>\n\n<h4>2.0<\/h4>\n\n<ul>\n<li>replaced legacy bbPress code with proper implementation, major performance increase over bbPress default implementation<\/li>\n<li>updated message defaults to be more user friendly<\/li>\n<li>added filters to be backwards compatible with bbPress<\/li>\n<li>added filters to be forwards compatible with bbPress once this plugin's code is incorporated into bbPress core<\/li>\n<\/ul>\n\n<h4>1.5<\/h4>\n\n<ul>\n<li>removed filter <code>abbps_to<\/code>, use <code>abbps_recipients<\/code> instead<\/li>\n<li>invoke <code>wp_specialchars_decode()<\/code> on blog name for From name<\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>updated code to match filter changes in bbPress 2.5.6<\/li>\n<li>now properly injects bbPress, using the <code>bbp_after_setup_actions<\/code> hook<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>new filter: <code>abbps_bounce_address<\/code> allows setting of bounce address for email notifications<\/li>\n<li>minor code improvements<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>changed filter: <code>abbps_from<\/code> to match the signature of the <code>abbps_to<\/code> filter (now passes an associative array instead of two strings).<\/li>\n<li>removed obsolete parameters from <code>abbps_to<\/code> <code>apply_filters()<\/code> call<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>changed filter: <code>abbps_to<\/code> has new signature <code>abbps_to( $to, $post_author_user_id )<\/code> where $to is <code>array( 'name' =&gt; '', 'address' =&gt; '' )<\/code><\/li>\n<li>new filter: <code>abbps_recipients<\/code> filters array of recipients just before sending so you can e.g. remove blacklisted emails just in time<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>initial release<\/li>\n<\/ul>","raw_excerpt":"Email notifications done right. No BCC lists, no added page load time, better performance.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/35048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=35048"}],"author":[{"embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mechter"}],"wp:attachment":[{"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=35048"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=35048"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=35048"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=35048"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=35048"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ewe.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=35048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}