Complete Documentation – English
🔄 Changelog
Version 1.3
- Batch email sending system
- WP Mail SMTP compatibility
- Enhanced admin interface
- Detailed logging
Version 1.2
- Block editor support
- Email template improvements
- Minor bug fixes
Version 1.1
- Basic newsletter functionality
- Subscriber management
- Subscription forms
Need help? Check the documentation on GitHub or create an issue for technical support.
📋 Table of Contents
- Introduction
- Installation
- Initial setup
- Creating a newsletter
- Subscriber management
- Batch email system
- Resending newsletters
- Advanced configuration
- Troubleshooting
- Hooks and filters
- FAQ
🎯 Introduction
Create A Newsletter With The Block Editor (CANWBE) is a WordPress plugin that allows you to create and send professional newsletters using WordPress’s native block editor (Gutenberg).
✨ Key features:
- Visual editor: Use WordPress block editor
- Batch sending: Smart system to prevent server overload
- Subscriber management: Easily manage your subscriber list
- SMTP compatibility: Works with WP Mail SMTP and other email plugins
- Detailed logs: Complete tracking of sends and errors
- Responsive: Newsletters that look great on all devices
🚀 Installation
Automatic installation:
- Go to Plugins → Add New
- Search for “Create A Newsletter With The Block Editor”
- Click “Install Now”
- Activate the plugin
Manual installation:
- Download the plugin from the repository
- Upload the folder to
/wp-content/plugins/ - Activate the plugin from Plugins → Installed Plugins
System requirements:
- WordPress 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.6 or higher
- Recommended PHP memory: 128MB minimum
⚙️ Initial setup
1. Plugin access
After activation, you’ll find:
- Newsletter in the WordPress sidebar menu
- Submenus: All newsletters, Add new, Email Batches
2. Basic configuration
- Go to Newsletter → Settings
- Configure:
- Sender email
- Sender name
- Unsubscribe message
- Confirmation page
3. SMTP configuration (Recommended)
For better delivery results, configure SMTP:
- Install WP Mail SMTP or similar
- Configure your email provider (Gmail, SendGrid, etc.)
- Test sending before using the plugin
✍️ Creating a newsletter
1. New newsletter
- Go to Newsletter → Add new
- Enter a title for your newsletter
- Use the block editor to create content
2. Recommended blocks
- Paragraph: For main text
- Headings: For titles and sections
- Image: For visual content
- Button: For call-to-actions
- Columns: For complex layouts
- Spacer: To control spacing
3. Design best practices
- Maximum width: 600px for email client compatibility
- Images: Optimize size (maximum 1MB per image)
- Colors: Use consistent palettes with your brand
- Text: Keep paragraphs short and readable
- CTAs: Use clear and prominent buttons
4. Preview
- Use preview before publishing
- Test on different devices
- Verify all links
👥 Subscriber management
1. Who receives newsletters?
By default, newsletters are sent to:
- Registered users in WordPress
- Specific roles (configurable)
- Custom lists (if configured)
2. Configure recipients
// In your theme's functions.php, you can filter subscribers:
add_filter('canwbe_newsletter_subscribers', function($subscribers, $post_id) {
// Filter by role
return array_filter($subscribers, function($user) {
return in_array('subscriber', $user->roles);
});
}, 10, 2);
3. Subscription form
Create a registration form:
<form method="post" action="">
<input type="email" name="subscriber_email" required placeholder="Your email">
<input type="hidden" name="action" value="canwbe_subscribe">
<?php wp_nonce_field('canwbe_subscribe', 'canwbe_nonce'); ?>
<button type="submit">Subscribe</button>
</form>
📬 Batch email system
1. How it works?
The plugin divides email sending into small batches to:
- Avoid server timeouts
- Reduce server load
- Improve deliverability
- Allow progress tracking
2. Batch configuration
Default configuration:
- Emails per batch: 10
- Delay between batches: 30 seconds
- Maximum retries: 3
- Retry delay: 5 minutes
3. Monitor sending
- Go to Newsletter → Email Batches
- You’ll see:
- Batch status: Queued, Processing, Completed, Cancelled
- Progress: Percentage completed
- Statistics: Sent/Failed/Total
- Actions: Cancel active batches
4. Batch states
- 🔵 Queued: In queue, waiting for processing
- 🟡 Processing: Actively sending emails
- 🟢 Completed: Fully sent
- 🔴 Cancelled: Cancelled by administrator
- ❌ Failed: Critical error
🔄 Resending newsletters
✅ Recommended method: Duplication
- Copy the content from the original newsletter
- Create a new newsletter
- Modify the subject (e.g., “REMINDER: [Original title]”)
- Schedule sending
⚠️ Alternative method: Draft and republish
- Edit the existing newsletter
- Change status to “Draft”
- Update the post
- Publish again
Note: This method will resend to ALL subscribers.
🔧 Avoiding duplicate sends (Advanced)
// Filter users who already received the newsletter
add_filter('canwbe_newsletter_subscribers', function($subscribers, $post_id) {
$already_sent = get_post_meta($post_id, '_canwbe_sent_users', true) ?: array();
return array_filter($subscribers, function($subscriber) use ($already_sent) {
return !in_array($subscriber->ID, $already_sent);
});
}, 10, 2);
📋 Checklist before resending
- [ ] Is it necessary to resend to EVERYONE?
- [ ] Is the content still relevant?
- [ ] Have you modified the email subject?
- [ ] Have you added a note about the resend?
- [ ] Have you reviewed content errors?
🔧 Advanced configuration
1. Customize batch settings
// In functions.php
add_filter('canwbe_batch_size', function($size) {
return 25; // Change to 25 emails per batch
});
add_filter('canwbe_batch_delay', function($delay) {
return 60; // Change to 60 seconds between batches
});
add_filter('canwbe_max_retries', function($retries) {
return 5; // Change to 5 maximum retries
});
2. Customize email templates
// Modify email HTML
add_filter('canwbe_email_template', function($html, $content, $post_id) {
// Your custom logic here
return $html;
}, 10, 3);
3. Custom CSS for emails
// Add custom CSS
add_filter('canwbe_email_styles', function($css) {
$css .= '
.my-custom-class {
color: #ff0000;
font-weight: bold;
}
';
return $css;
});
4. Webhooks and notifications
// Notification when batch completes
add_action('canwbe_batch_completed', function($batch_id, $batch_data) {
// Send webhook to your external system
wp_remote_post('https://your-system.com/webhook', array(
'body' => json_encode($batch_data),
'headers' => array('Content-Type' => 'application/json')
));
}, 10, 2);
🛠️ Troubleshooting
❌ Common errors
1. “Call to undefined method get_batch_size()”
Solution: Add missing methods in batch-email-sender.php:
public static function get_batch_size() {
return apply_filters('canwbe_batch_size', self::BATCH_SIZE);
}
public static function get_batch_delay() {
return apply_filters('canwbe_batch_delay', self::BATCH_DELAY);
}
public static function get_max_retries() {
return apply_filters('canwbe_max_retries', self::MAX_RETRIES);
}
2. Emails not sending
Possible causes:
- Incorrect SMTP configuration
- Hosting limits
- Cache plugin interfering
- Cron jobs not working
Solutions:
- Install WP Mail SMTP
- Contact hosting provider
- Exclude plugin from cache
- Verify WP Cron
3. Emails going to spam
Solutions:
- Configure SPF, DKIM, DMARC
- Use professional SMTP service
- Avoid spam words in subject
- Include unsubscribe link
📊 Logs and debugging
// Enable detailed logs
define('CANWBE_DEBUG', true);
// View logs in wp-content/debug.log
ini_set('log_errors', 1);
ini_set('error_log', ABSPATH . 'wp-content/debug.log');
🔍 Configuration verification
- PHP configuration:
memory_limit,max_execution_time - WP Cron: Verify it’s working correctly
- SMTP: Test sending
- Permissions: Correct files and directories
🎣 Hooks and filters
Available filters
// Modify subscribers
add_filter('canwbe_newsletter_subscribers', $callback, 10, 2);
// Modify email content
add_filter('canwbe_email_content', $callback, 10, 3);
// Modify email subject
add_filter('canwbe_email_subject', $callback, 10, 2);
// Modify batch configuration
add_filter('canwbe_batch_size', $callback);
add_filter('canwbe_batch_delay', $callback);
add_filter('canwbe_max_retries', $callback);
// Modify HTML template
add_filter('canwbe_email_template', $callback, 10, 3);
Available actions
// Before sending newsletter
add_action('canwbe_before_send_newsletter', $callback, 10, 2);
// After sending newsletter
add_action('canwbe_after_send_newsletter', $callback, 10, 2);
// When batch completes
add_action('canwbe_batch_completed', $callback, 10, 2);
// When email fails
add_action('canwbe_email_failed', $callback, 10, 3);
// When batch is cancelled
add_action('canwbe_batch_cancelled', $callback, 10, 1);
Usage examples
// Example: Log custom statistics
add_action('canwbe_batch_completed', function($batch_id, $batch_data) {
update_option('my_newsletter_stats_' . $batch_data['post_id'], array(
'sent' => $batch_data['sent_emails'],
'failed' => $batch_data['failed_emails'],
'date' => current_time('mysql')
));
});
// Example: Notify Slack when newsletter is sent
add_action('canwbe_after_send_newsletter', function($post_id, $subscribers) {
$webhook_url = 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL';
$message = sprintf(
'Newsletter "%s" sent to %d subscribers',
get_the_title($post_id),
count($subscribers)
);
wp_remote_post($webhook_url, array(
'body' => json_encode(array('text' => $message)),
'headers' => array('Content-Type' => 'application/json')
));
});
❓ FAQ
How many emails can I send?
It depends on your hosting and SMTP configuration. Most hostings allow 100-300 emails/hour.
Is it compatible with WooCommerce?
Yes, you can send newsletters to WooCommerce customers by filtering user roles.
Does it work with Multisite?
The plugin works on each site independently in a Multisite installation.
Can I schedule newsletters?
Use WordPress’s “Schedule” function to send newsletters on specific dates.
How do I import subscribers?
You can import users to WordPress using plugins like “Import Users from CSV” and then use this plugin.
Is there a subscriber limit?
There’s no limit in the plugin, but your hosting and SMTP provider may have restrictions.
📞 Support
Report bugs
- GitHub: Create issue
- WordPress.org: Plugin support forum
Request features
- Use GitHub for new feature requests
- Describe your need in detail
- Include specific use cases
Contribute
- Fork the repository on GitHub
- Create a branch for your feature
- Send a pull request with detailed description
📄 License
This plugin is licensed under GPL v2 or later.