This package provides some of the newsletter functionality for Jetpack, including:
- Settings page — A wp-admin settings screen for newsletter configuration (
Jetpack > Newsletter). - URL helper — Centralized logic for generating the correct newsletter settings URL based on site type and configuration.
- Reader link — An admin bar link to the WordPress.com Reader.
Other functionality remains in the subscriptions module of Jetpack itself.
Both Settings and Reader_Link use singleton-style initialization. Call their init() methods early (e.g., on plugins_loaded):
use Automattic\Jetpack\Newsletter\Settings;
use Automattic\Jetpack\Newsletter\Reader_Link;
Settings::init();
Reader_Link::init();Registers a Jetpack > Newsletter submenu page in wp-admin with a React-based settings UI.
Controls visibility of the Jetpack > Newsletter menu item. Defaults to true. Set to false to hide the menu item while keeping the page accessible via direct URL.
add_filter( 'jetpack_show_newsletter_menu_item', '__return_false' );When the subscriptions module is active, a notice is added to the wp-admin Settings → Reading page next to the "For each post in a feed" option. It clarifies that the RSS excerpt setting does not control newsletter emails and links to the Newsletter settings page.
Urls::get_newsletter_settings_url() returns the wp-admin newsletter settings URL.
Reader_Link::activate_on_connection() auto-activates the wpcom-reader module when a site is first connected to WordPress.com. It skips activation if modules were previously initialized (e.g., the user disconnected and reconnected), respecting prior module choices.
If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
Jetpack Newsletter is licensed under GNU General Public License v2 (or later)