分类文章订阅

描述

This plugin lets a user subscribe and unsubscribe to posts within a certain category or categories.
Subscribers will receive an e-mail notification with a link to the actual post.

For a complete overview of STC read: STC’s User Manual version 2.5.9.
This document also includes a Step by Step Get Started chapter.

The following features are available

  • E-mail notification template with placeholders
  • Custom Posts
  • Custom Taxonomies
  • Enhanced keyword search in Title, Content, Tags and Taxonomies
  • E-mail notification on timer or daily basis
  • SMS notification on timer or daily basis
  • For newly created and / or updated Posts
  • Works with classic editor and the block editor
  • Export and Import subscribers
  • Implementation by widget and / or by shortcode

Usage

For a complete overview of STC read: STC User Manual

屏幕截图

  • 设置页面展示的是STC订阅的菜单结构。
  • With Bootstrap framework.
  • Without Bootstrap framework, override and add your own CSS.
  • When resend post is enabled in settings there is a new option available when editing a post.
  • When resend post and Gutenberg editor settings are both enabled, resend options are available in the Gutenberg document tab
  • Taxonomy edit possibility
  • STC Subscribers list with one custom taxonomy called "Taxonomies"
  • 通过短代码创建订阅(树状图模式)
  • 通过短代码创建订阅(普通清单模式)
  • 启用通知邮件中的6个HTML模块。
  • 通知邮件模板开启
  • 设置小工具属性

安装

This section describes how to install the plugin and get it working.

  1. subscribe-to-category上传到/wp-content/plugins/目录
  2. Activate the plugin through the ‘Plugins’ menu in WordPress Admin
  3. Inspect and Save your settings with the dashboard menu item ‘STC Subscribe > Settings’.
  4. Create a page and add shortcode [stc-subscribe] or use the STC Widget to display STC form subscription.
  5. Inspect /create / update subscribers with the dashboard menu item STC Subscriber > Subscribers

Shortcode Attributes

‘category_in’ – Use this attribute if you only want one or several categories to be available for subscription. Value to be entered is the name of the category. Note that only level 0 (no parent) values can be entered.
‘category_id_in’ – The difference to above is to use the category ID instead of category name.
‘category_not_in’ – Use this attribute if you want to exclude categories to be available for subscription. Value to be entered is the name of any category.
‘category_id_not_in’ – The difference to above is to use the category ID instead of category name.
For the above attributes you can use a comma sign to separate multiple categories, like [stc-subscribe category_in=”news, article”].

‘hide_unsubscribe’ – hide_unsubscribe=”true” disables the unsubscribe feature but only if the shortcode attribute is also enabled at the admin setting
‘treeview_folded’ – treeview_folded=”false” unfolds the category / taxonomy tree view by default
‘treeview_enabled’ – treeview_enabled=”false” displays the categories / taxonomies as one list ignoring hierarchy. Please note that only the selected categories are in or out
‘keyword_search’ – keyword_search=”on” enables the search for keywords in new or updated selected post types. Default is keyword_search=”off”
‘subscriber_notification’ – subscriber_notification=”true” enables email notification on an individual per subscriber basis. Default is subscriber_notification=”false”
‘mobile_phone’ – mobile_phone=”on” enables the SMS Notification function. This will send SMS Notifications just like the the E-mail notifications for new or updated posts.

Filter and hooks

Following filters and hooks can be used for customizing the email message.

<?php
// FILTERS
// Parameters: $value
add_filter( 'stc_message_length_sum_of_words', 'stc_message_length_sum_of_words', 10, 1 ); //set return value to a negative number to show the full content


// Parameters: $value, $post_id, $subscriber_post_id
add_filter( 'stc_message_title_html', 'my_stc_message_title_html', 10, 3 );
add_filter( 'stc_message_link_to_post_html', 'my_stc_message_link_to_post_html', 10, 3 );
add_filter( 'stc_message_unsubscribe_html', 'my_stc_message_unsubscribe_html', 10, 3 );
add_filter( 'stc_message_subscribe_html', 'my_stc_message_subscribe_html', 10, 3 );

// HOOKS
// Parameters: $post_id, $subscriber_post_id  
add_action( 'stc_before_message', 'my_stc_before_message', 10, 2 );
add_action( 'stc_before_message_title', 'my_stc_before_message_title', 10, 2 );
add_action( 'stc_after_message_title', 'my_stc_after_message_title', 10, 2 );
add_action( 'stc_before_message_content', 'my_stc_before_message_content', 10, 2 );
add_action( 'stc_after_message_content', 'my_stc_after_message_content', 10, 2 );
add_action( 'stc_after_message', 'my_stc_after_message', 10, 2 );

// Parameters: $subscriber_post_id, $categories, bool $all_categories
add_action( 'stc_after_update_subscriber', 'my_stc_after_update_subscriber', 10, 3 );
add_action( 'stc_after_insert_subscriber', 'my_stc_after_insert_subscriber', 10, 3 );

// Parameters: $subscriber_post_id, 
add_action( 'stc_before_unsubscribe', 'my_stc_before_unsubscribe', 10, 1 ); // runs before deleting a subscriber from database
add_action( 'stc_before_subscribe', 'my_stc_before_subscribe', 10, 1 ); // runs before adding a subscriber to the database


/**
 * Example for adding featured image to STC email
 */
function my_stc_after_message_title( $post_id ){
    echo get_the_post_thumbnail( $post_id, 'thumbnail' );
}
add_action( 'stc_after_message_title', 'my_stc_after_message_title', 10, 2 );

?>

Optionally but recommended

As WordPress Cron is depending on that you have visits on your website you should set up a Cron job on your server to hit http://yourdomain.com/wp-cron.php at a regular interval to make sure that WP Cron is running as expected. In current version of Subscribe to Category the WP Cron is running once every hour, that might be an option that is changeable in future versions.
Therefore, a suggested interval for your server Cron could be once every 5 minutes.

常见问题

让STC插入额外的HTML内容到通知邮件里

是的,在通知邮件中通过使用可行的hooks置入HTML,这需要一些编程技巧。在2.4.9版本后,同时样式将有有更多的可能性。你可以在screenshot-10.jpg中看到在哪里你可以置入代码。

要重新开始的最好方法就是把所有的HTML邮件模板删除(已发布的与已删除的)。之后STC订阅将自动设置一个可编辑的模板文件,如screenshot-11中一样。别忘了在STC订阅-> 设置中,选中这个模板。

Or follow the 3 steps below.
step 1: STC Subscribe->Notifications->Add New notification to create a new e-mail notification template.
Step 2: Edit the post best in block-editor using a single html block. All styling must be within each HTML element. Remember not all email providers handle all HTML styles. Use the placeholders like {{post_title}},{{post_content}},{{justify}} and {{unsubscribe}}. For more details look in Chapter 5 of STC’s User Manual
step 3: Enable the required post template in the STC admin settings.

STC小工具能够控制属性吗?

是的,从2.4.16版本起,小工具设置中就添加了属性区域。格式与短码中使用的相同。

STC能够兼容自定义文章类型吗

是的,从2.4.1版本开始,用户可以将自定义文章分类和STC进行捆绑,你可以在STC设置页面选择“自定义文章类型”。

Can STC handle custom Taxonomies

Yes, from version 2.3.1 it is possible to link STC with Custom created Taxonomies. You can activate these within STC on the STC admin settings page.

为什么我只有0层级的分类在过滤器中

这是因为你选择了一个子分类作为过滤器,树状图无法在分类结构的中间开始展示。但是,当属性 ‘treeview_enabled=”false”‘ 被激活时,你可以选择一个没有父级的子分类,他们将会显示成单个的分类项。

我如何能够启动普通清单模式而不是树状图模式

你可以通过设置短代码 attribute treeview_enabled=”false” 设置分类形式为清单模式。请注意,当次属性被激活后,在过滤器里的分类层级将被忽略,结果将和过滤器属性的清单模式一样。

导入订阅者名单的文件格式是什么?

STC 只能处理表单文件,因为分类信息都会被逗号隔开的。
Excel文件能支持你导出txt文件的表单。

评价

2021年5月6日
This plugin does exactly what it should and it comes with amazing support. Some other review says: "Do one thing and do it well" I totally agree.
2021年4月6日
Curious about functionality: What I am looking is: as blog Reader, be able to subscribe only to certain Categories in Posts (get emails). Doable?
2021年3月15日
Our deepest gratitude, Sidney. This is wonderful and so is your support with the odd array of challenges specific to my client's site and setup. Highly recommend. I'd encourage the developers to create a Pro version - we will happily purchase.
2021年2月10日
I ran into a glitch with custom posts being accidentally pushed out on republish. After I reported the bug to the support forum, vandestouwe not only replied within no time at all, but also fixed it and developed a new feature in the process. Amazing!
阅读所有27条评价

贡献者及开发者

“分类文章订阅” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

“分类文章订阅”插件已被翻译至5种本地话语言。 感谢所有译者为本插件所做的贡献。

将“分类文章订阅”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

  • Added attribute to show taxonomy hierarchy in the reason why a notification was sent.

2.5.9

  • Added attribute to show taxonomy hierarchy in the reason why a notification was sent.
  • minor bug fixes

2.5.8

  • Fixed warning on directory or file does not exsist
  • Fixed problems with containers with two or more columns

2.5.7

  • added confirmpage slug: stcs-confirmation-page for stage one of email confirmation
  • added SMS Notification feature (workonly with TextMagic as send sms provider)
  • Fixed problem with email notification subject
  • Fixed mixed some text messages wrongly using Blog where it should be Post
  • Fixed problem with do not send this Post on new/update
  • minor bug fixes.

2.5.5

  • added landingspage with slug stcs-landing-page
  • solved bug in succesfull reply on import susbscribers
  • solved bug in subscribers not having a proper default value for individual subscribtions

2.5.4

  • new placeholders
  • choice for weekdays, daily and hourly notifications on individual basis
  • problem with word / character cutoff in middle of html tag’s
  • small bugfixes

2.5.3

  • added new place holder {{post_excerpt}}
  • added new place holder {{post_featured_image}}
  • new STC Basic e-Mail Template V2.1 (delete older versions)
  • solved problem {{search_reason}} containing “” in some cases.

2.5.2

  • added possibility in the post ducoment sidebar to inhibbit send e-mail notifications
  • Ignore default treeview enabled when category attributes are used in the same shortcode this makes it possible to upgrade STC from older (before treeview) versions

2.5.1

  • revised readme.txt and introduction of STC’s User Manual
  • Added enhanced keyword search facilities.
  • Added stc_update_count_callback function which filters out the terms count for custom post type ‘stc’.
  • Check for STC meta keys present on custom posts created by others. Add STC meta keys/values if not present.
  • Added more placeholders to control the e-mail notification template
  • For newly created e-mail notification post are created with content explanatory content and possible placeholders.
  • small bugfixes

2.4.18

  • Removal of all the non textual tags preventing cutoff’s causing e-mail layout failure
  • Added multibyte characters count for the E-Mail Notification
  • Added hidden

tags to separate multiple updates and / or saves posts. HR styling is available in body class “stc-notify-hr”
* Added workaround to control justification in the contents row of the e-mail notification template. text-align: left”>{{post_content}} is used by STC to replace the word left for center allowing dynamic justification depending on content cutoff is 0 or > 0
* small bugfixes

2.4.17

  • Created “STC Demo E-mail Template V1.1” to enable background-color style change with Chinese SMTP provider (tested with outlook, gmail and exmail).
  • Improved handling of E-mail Template
  • small bugfixes

2.4.16

  • Unsubscribe via e-mail link firing more then once causing incorrect fault message
  • New single HTML E-mail Notification layout with placeholders for title, content and unsubscribe
  • Widget settings for STC Widget: new possibility to use shortcode attributes
  • small bugfixes

2.4.14

  • adding a feature to send all email notifications once per day
  • revised the STC Settings Notification E-mail status pane
  • small bugfixes

2.4.12

  • Added/Revised code and HTML section post to create an initial html template setup like in screenshot-11. Delete all HTML sections (published and trashed) to replace existing HTML sections
  • corrected quite a view spelling mistakes in messages and readme.txt
  • small bugfixes

2.4.11

  • Redesigned the STC menu structure. Dashboard: STC Subscribe => Submenu: (Settings, Notifications, Subscribers)
  • Added code to create the basic notification structure automatically (if HTML section names not checked && post does not exist) {wp_insert_post(….)}
  • small bugfixes

2.4.10

  • created a way that categories are default on until the user itself disables it through STC admin settings
  • redesigned option structure for compatibility reasons

2.4.9

  • major change in adding HTML text to the notification e-mail (read FAQ concerning HTML inserts)
  • categories can now be disabled to accommodate users how only work with custom taxonomies
  • small bugfixes

2.4.8

  • small bug fixes.

2.4.7

  • STC used Sendmail instead of PHPMailer because in version 5.5 from WordPres wp_mail can’t cope with a encoded_basic64. Analasys of the PHPMailer’s showed that it takes care of 8-bit characters itself so no need to do this in STC. wp_mail() again used enabling Mail plugins to pick up STC mails.

2.4.6

  • added attribute ‘treeview_folded’ -> treeview_folded=”false” unfolds the category / taxonomy tree view by default
  • added attribute ‘treeview_enabled’ -> treeview_enabled=”false” displays the categories / taxonomies as one list ignoring hierarchy. Please note that only the selected categories are in or out
  • added/changed some French translations
  • small bug fixes.

2.4.5

  • filter categories caused the tree view to be messed up completely now any category can be taken out but only categories of level 0 can be filtered in.

2.4.4

  • allow for no categories or taxonomies selected at all
  • fixed issue that subscribers in trash taxonomies where picked up
  • fixed issue displaying wrong indent for category and taxonomy treeview

2.4.3

  • fixed issue on shortcodes attributes: category_in, category_id_in, category_not_in, category_id_not_in

2.4.2

  • fixed issue on STC settings page when no custom post or no custom taxonomies where available
  • fixed issue on subscription warning when no taxonomies where selected
  • fixed issue on first use of the block editor STC resend checkbox

2.4.1

  • Added Custom Posts Functionality
  • Minor bugfixes

2.3.9

  • Fixed error in CSS file stc-tax-style.css causing CSS optimization to fail

2.3.8

  • Revised category and taxonomy selection for the shortcode and widget
  • Several changes to make understand STC better
  • Fix bug in wp-mail sending corrupted base64 encode subject in notification
  • Other bugfixes

2.3.6

*bugfixes

2.3.5

  • Small changes to adapt to WP 5.5
  • bugfixes

2.3.1

  • New admin setting to select custom taxonomies names (shortcode for taxonomy selection comes later for now use admin edit of subscription)
  • Multiple post to one subscriber are added together in one notification.
  • bugfixes

2.2.1

  • Introduced subscriber verification for subscriptions and updates while not logged in to WordPress
  • Introduced disabling of the unsubscribe checkbox
  • New admin setting to control the length of the content in the email notification
  • bugfixes

2.1.7

  • Added email conformation to intended STC subscriber. When confirmed the new STC subscriber becomes active. This is not required when the user is in admin mode.

2.1.6

  • minor bugfixes

2.1.5

  • changed subscription method for existing subscribers to enable updating the subscription
  • bug fixed with only one category causing nothing to show

2.1.4

  • Changed text for using the Gutenberg/Block editor to be more clear
  • Redirect to first page after subscription stays now on the current page
  • Bug fixed causing not to update the subscribers when using the classic WP editor

2.1.3

  • Added an admin feature to import a csv subscriber list in exactly the same format as created by the export function

2.1.2

  • Added an admin setting to control the WP-Cron STC rescheduling “send email time”. Default is 3600 second but the user can now set it to any value between 180 and 3600 => 2 minutes and 1 hour

2.1.1

  • during sanitizing process, the email address from the unsubscriber lost the “@” sign causing failed unsubscribing issues

2.1.0

  • implemented sanitizing and escaping according WPCS
  • adapted internationalization text domain to plugin standards
  • added ‘numberposts’ => -1 to the arguments for exporting all subscribers to excel it was defaulting to a maximum of 5
  • minor bugfixes

2.0.0

  • adapted STC to wp 5.3 features by adding a STC resend option to the document tab

1.9.0

  • Email address preset for logged in users.
  • Japanese, Dutch, German and Norwegian language added.

1.8.1

  • Added pot file to be used for translation.
  • Bugfix – changed text domain to string instead of constant.

1.7.0

  • Added some new hooks: stc_after_update_subscriber, stc_after_insert_subscriber, stc_before_unsubscribe.

1.6.0

  • Added a Widget for subscription form.
  • Don’t show category list if only one is available (thanks to davefx).
  • Extended short code attributes with an option to use category id instead of category name (thanks to Stingray_454).

1.3

  • Added hooks and filters to make the plugin extensible.
  • Added Lithuanian language.

1.2.1

  • Fixed some undefined variables that might have caused some errors for some environments.
  • Renamed language files for Russian language to correct syntax.
  • Added Italian language.

1.2.0

  • Possibility to re-send a post on update that has already been sent. This option needs to be activated in the settings for the plugin.
  • Attribute ‘category_in’ added to shortcode to show only entered categories in the subscribe form. Multiple categories are separated by a comma sign.
  • Attribute ‘category_not_in’ added to shortcode to exclude categories in the subscribe form. Multiple categories are separated by a comma sign.

1.1.0

  • Added php sleep() function to prevent sending all e-mails in the same scope.
  • Using Ajax when send is manually triggered in back-end.

1.0.0

  • First release