Newsletter: allow defaulting to "post only" for the site
Could be a PHP filter for starters, or a setting somewhere next up.
This snippet of code sets the default to "do not send":
function register_meta_args_filter_jetpack_dont_send_post_by_default( $args, $defaults, $object_type, $meta_key ) {
if ( $meta_key !== '_jetpack_dont_email_post_to_subs' ) {
return $args;
}
$args['default'] = 1;
return $args;
}
add_filter( 'register_meta_args', 'register_meta_args_filter_jetpack_dont_send_post_by_default', 10, 4 );
Now when you hit publish on new posts:
If we would want to add more straightforward filter, we'd add it here:
https://github.com/Automattic/jetpack/blob/f8ce5bc19593297b09dfb1ffaed4251ca9df4927/projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php#L96-L100
A user requested this here: 8749653-zen
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 8749653-zen
I just sent seven emails today, completely forgetting about this functionality. I was adding posts to my backlog. They weren't meant to be highlighted. I only realized I had sent those newsletters when I saw my subscriber count drop. The button just blends into the interface. It's my fault, yes, but it needs some guardrails for folks like me! First, thank you @simison for the filter code. I've added it to my theme.
I would love to see an option to choose my default. Or, at least provide a confirm dialog warning when posting to email.
Thank you!