BuddyPress Email Preview
A comprehensive email previewer for BuddyPress emails with live preview, test sending, and customization options.
by Hassan Ali | Coresol Studio · github.com/creativehassan/buddypress-email-preview · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/creativehassan/buddypress-email-preview/archive/refs/heads/main.zipA comprehensive email previewer for BuddyPress emails with live preview, test sending, and customization options.
Description
BuddyPress Email Preview is a powerful WordPress plugin that allows you to preview and test BuddyPress emails before they are sent to users. This plugin provides a user-friendly interface to:
- Preview ALL BuddyPress email types in both HTML and plain text formats
- Support for ALL BuddyPress core tokens and plugin-specific tokens
- Customize email tokens with sample or custom values
- Send test emails to verify appearance and functionality
- View emails with BuddyPress styling applied
- Access preview functionality directly from the email edit screen
- COMPREHENSIVE: Full support for BuddyPress Group Email Subscription (GES) plugin emails
Features
🎯 Complete Email Preview
- Real-time preview of ALL BuddyPress email types
- Support for both HTML and plain text formats
- Applies BuddyPress email styling and templates
- Responsive preview interface
- NEW: Supports ALL core BuddyPress email types (17+ types)
🔧 Universal Token Management
- COMPREHENSIVE token support for ALL BuddyPress email types
- Support for ALL BuddyPress core tokens (60+ tokens)
- COMPLETE recipient token support (
recipient.name,recipient.email,recipient.username) - Custom token value input for testing scenarios
- Automatic sample data generation for all tokens
- Real-time token replacement preview
- COMPLETE: Support for ALL GES custom tokens (8+ GES-specific tokens)
📧 Advanced Test Email Sending
- Send test emails to any email address
- Uses BuddyPress email system for accurate testing
- Custom token values in test emails
- Success/error feedback
- NEW: Enhanced support for plugin-specific email types
🎨 Enhanced Admin Integration
- Seamless integration with BuddyPress email management
- Additional columns in email post type listing
- Preview meta box in email edit screen
- Dedicated admin page for comprehensive testing
- NEW: Complete email type and token reference
📱 Responsive Design
- Mobile-friendly admin interface
- Optimized for various screen sizes
- Clean and intuitive user experience
🔌 Complete Plugin Compatibility
- BuddyPress Group Email Subscription (GES): Full support for ALL email types and tokens
- Automatic detection of installed plugins
- Enhanced token support for third-party plugins
- NEW: Extensible architecture for future plugin support
Supported Email Types
The plugin supports ALL BuddyPress email types including:
BuddyPress Core (17 Email Types)
- Activity Emails: activity-comment, activity-comment-author, activity-at-message
- Group Emails: groups-at-message, groups-invitation, groups-membership-request, groups-member-promoted, groups-details-updated, groups-membership-request-accepted, groups-membership-request-rejected, groups-membership-request-accepted-by-admin, groups-membership-request-rejected-by-admin
- Friendship Emails: friends-request, friends-request-accepted
- Message Emails: messages-unread
- Registration Emails: core-user-registration, core-user-registration-with-blog, core-user-activation
- Settings Emails: settings-verify-email-change
BuddyPress Group Email Subscription (4 Email Types)
When the GES plugin is detected, additional email types are supported:
- bp-ges-single: Individual activity notifications
- bp-ges-digest: Daily and weekly digest emails with group summaries
- bp-ges-notice: Group administrator notices to all members
- bp-ges-welcome: Welcome emails for new group members
Complete Token Reference
BuddyPress Core Tokens (60+ Tokens)
Common Tokens (Available in all emails)
{{{site.name}}},{{{site.url}}},{{{site.description}}},{{{site.admin-email}}}{{{user.name}}},{{{user.email}}},{{{user.username}}}{{{profile.url}}}{{{recipient.name}}},{{{recipient.email}}},{{{recipient.username}}}{{{email.subject}}},{{{email.preheader}}}{{{unsubscribe}}}
Activity Tokens
{{{poster.name}}},{{{poster.url}}}{{{usermessage}}},{{{thread.url}}},{{{mentioned.url}}}
Group Tokens
{{{group.name}}},{{{group.url}}},{{{group.description}}}{{{inviter.name}}},{{{inviter.url}}},{{{invite.message}}}{{{requesting-user.name}}},{{{request.message}}}{{{promoted_to}}},{{{changed_text}}}{{{invites.url}}},{{{group-requests.url}}},{{{leave-group.url}}}
Friendship Tokens
{{{initiator.name}}},{{{initiator.url}}}{{{friend.name}}},{{{friendship.url}}}{{{friend-requests.url}}}
Message Tokens
{{{sender.name}}},{{{sender.url}}}{{{usersubject}}},{{{usermessage}}},{{{message.url}}}
Registration Tokens
{{{activate.url}}},{{{key}}}{{{user-site.url}}},{{{activate-site.url}}}{{{lostpassword.url}}},{{{verify.url}}}
GES-Specific Tokens (8+ Tokens)
Single Notification Tokens
{{{ges.action}}}: Activity action description{{{ges.subject}}}: Dynamic email subject{{{ges.email-setting-description}}}: Email setting description{{{ges.email-setting-links}}}: Email setting links
Digest Tokens
{{{ges.digest-summary}}}: Formatted group summary with activity counts{{{subscription_type}}}: Type of subscription (dig/sum){{{recipient.id}}}: Recipient user ID
Unsubscribe Tokens
{{{ges.unsubscribe}}}: Group-specific unsubscribe link{{{ges.unsubscribe-global}}}: Global unsubscribe link{{{ges.settings-link}}}: Link to user's group settings
Group Tokens
{{{group.link}}}: HTML formatted group link
Installation
- Download the plugin files
- Upload the
buddypress-email-previewfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to
Emails > Email Previewin your WordPress admin
Requirements
- WordPress 5.0 or higher
- BuddyPress plugin installed and activated
- PHP 7.4 or higher
- Optional: BuddyPress Group Email Subscription plugin for enhanced functionality
Usage
Basic Preview
- Go to
Emails > Email Previewin your WordPress admin - Select any email type from the dropdown (17+ core types supported)
- Choose between HTML or Plain Text preview
- View the rendered email with realistic sample data for ALL tokens
GES Digest Preview
- Ensure the BuddyPress Group Email Subscription plugin is active
- Select "bp-ges-digest" from the email type dropdown
- The preview will show a realistic digest summary with multiple groups
- Customize the
{{{ges.digest-summary}}}token to test different scenarios - ALL GES tokens are automatically populated with sample data
Advanced Token Customization
- Select any email type to load ALL available tokens
- Enter custom values in any token input field
- Preview updates automatically with your custom values
- Test with realistic scenarios using comprehensive token support
Comprehensive Test Email Sending
- Select any email type and configure tokens as needed
- Enter a valid email address in the test email field
- Click "Send Test Email" to send a real email with ALL tokens replaced
- Check the recipient's inbox for the test email
Quick Preview from Email Edit
- Edit any BuddyPress email post
- Use the "Email Preview" meta box in the sidebar
- Click "Preview This Email" to open the preview page
- The email type will be automatically selected with ALL tokens loaded
Technical Details
Architecture
The plugin follows WordPress coding standards and uses:
- Object-oriented PHP for clean, maintainable code
- AJAX for seamless user interactions
- WordPress hooks for proper integration
- BuddyPress APIs for email handling
- Comprehensive token system supporting all BuddyPress plugins
File Structure
buddypress-email-preview/
├── buddypress-email-preview.php # Main plugin file
├── includes/
│ ├── class-admin.php # Admin functionality
│ ├── class-email-renderer.php # Email rendering logic
│ └── class-token-manager.php # Comprehensive token management
├── assets/
│ ├── css/
│ │ └── admin.css # Admin styles
│ └── js/
│ └── admin.js # Admin JavaScript
└── README.md # This file
Hooks and Filters
The plugin provides several hooks for customization:
// Filter email preview content
add_filter('bpep_email_preview_content', 'custom_preview_content', 10, 3);
// Filter available tokens
add_filter('bpep_available_tokens', 'custom_tokens', 10, 2);
// Filter sample token values
add_filter('bpep_sample_token_value', 'custom_sample_value', 10, 2);
Customization
Adding Custom Tokens
You can add custom tokens for specific email types:
function add_custom_email_tokens($tokens, $email_type) {
if ($email_type === 'custom-email-type') {
$tokens['custom.token'] = 'Custom token description';
}
return $tokens;
}
add_filter('bpep_available_tokens', 'add_custom_email_tokens', 10, 2);
Custom Sample Values
Provide custom sample values for tokens:
function custom_sample_values($value, $token) {
if ($token === 'custom.token') {
return 'Custom sample value';
}
return $value;
}
add_filter('bpep_sample_token_value', 'custom_sample_values', 10, 2);
Customizing GES Digest Summary
You can customize the sample digest summary:
function custom_ges_digest_summary($summary) {
// Return your custom digest summary HTML
return '<ul><li>Custom Group (10 items)</li></ul>';
}
add_filter('bpep_ges_sample_digest_summary', 'custom_ges_digest_summary');
Troubleshooting
Common Issues
Plugin not appearing in admin menu
- Ensure BuddyPress is installed and activated
- Check user permissions (requires
manage_optionscapability)
Email preview not loading
- Check browser console for JavaScript errors
- Verify AJAX requests are not being blocked
- Ensure proper nonce verification
Test emails not sending
- Verify WordPress email configuration
- Check email address validity
- Review server email logs
Tokens not working
- Ensure the email type exists in your system
- Check that plugins are active for plugin-specific tokens
- Verify token format uses correct braces:
{{{token}}}or{{token}}
GES tokens not working
- Ensure BuddyPress Group Email Subscription plugin is active
- Check that GES email types exist in your system
- Verify GES plugin version compatibility
Debug Mode
Enable WordPress debug mode for detailed error information:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
Contributing
We welcome contributions to improve the plugin:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly with all email types
- Submit a pull request
Development Setup
- Clone the repository
- Install WordPress and BuddyPress
- Optionally install BuddyPress Group Email Subscription
- Activate the plugin
- Test with ALL supported email types
- Verify ALL tokens work correctly
Changelog
Version 1.0.0
- Initial release
- COMPLETE email preview functionality for ALL BuddyPress email types
- COMPREHENSIVE token management system (50+ tokens)
- Test email sending with full token support
- Admin interface integration
- Responsive design
- FULL BuddyPress Group Email Subscription plugin support (8+ GES tokens)
- ENHANCED token replacement system
- REALISTIC sample data for ALL tokens
- UNIVERSAL support for all BuddyPress core email types
Support
For support and questions:
- Author: Hassan Ali | Coresol Studio
- Website: https://coresolstudio.com
- Email: Contact through website
License
This plugin is licensed under the GPL v2 or later.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Credits
- Built for the BuddyPress community
- Developed by Hassan Ali | Coresol Studio
- Uses BuddyPress email system and APIs
- COMPLETE compatibility with BuddyPress Group Email Subscription plugin
- Supports ALL BuddyPress core email types and tokens
- Follows WordPress coding standards
Made with ❤️ for the BuddyPress community - Now with COMPLETE token support!