A comprehensive WordPress plugin that overrides WordPress's internal mail system with the Unsend API for reliable email delivery and enhanced tracking capabilities.
- Complete WordPress Mail Override: Replaces
wp_mail()function with Unsend API - Reliable Email Delivery: Use Unsend's robust infrastructure for better deliverability
- Email Logging: Track all email attempts with detailed logs
- Test Mode: Fallback to WordPress default mail if Unsend fails
- API Connection Testing: Verify your configuration before going live
- Statistics Dashboard: Monitor email success rates and performance
- Easy Configuration: Simple admin interface for all settings
- Attachment Support: Handle file attachments seamlessly
- HTML & Text Emails: Support for both HTML and plain text emails
- CC/BCC Support: Full support for carbon copy and blind carbon copy
- Template Integration: Work with Unsend email templates
- Security First: Secure API key handling and validation
- WordPress 5.0 or higher
- PHP 7.4 or higher
- An Unsend account with API access
- Valid Unsend API key
- Download the plugin files
- Upload the
unsend-wp-mailerfolder to your/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings β Unsend Mailer to configure the plugin
cd wp-content/plugins
git clone https://github.com/your-username/unsend-wp-mailer.git- Sign up for an Unsend account
- Navigate to your dashboard and generate an API key
- Copy the API key for configuration
- Go to WordPress Admin β Settings β Unsend Mailer
- Enter your Unsend API Key
- Configure your From Email (should be a verified domain in Unsend)
- Set your From Name
- Test the connection using the built-in test feature (always uses Unsend API directly, regardless of override settings)
- Enable Email Override when you're ready to go live
- Enable Logging: Keep track of all email attempts
- Test Mode: Enable during development for fallback protection
- From Email: Use a domain you've verified in your Unsend account
Once configured and enabled, the plugin automatically handles all WordPress emails through Unsend:
- User registration emails
- Password reset emails
- Comment notifications
- Contact form submissions
- E-commerce notifications
- Any plugin using
wp_mail()
The plugin works with the standard WordPress wp_mail() function:
// Basic usage
wp_mail('[email protected]', 'Subject', 'Message content');
// With headers and attachments
$headers = array('Content-Type: text/html; charset=UTF-8');
$attachments = array('/path/to/file.pdf');
wp_mail(
'[email protected]',
'Subject',
'<h1>HTML Message</h1>',
$headers,
$attachments
);// Use Unsend email templates
add_filter('unsend_wp_mail_process', function($atts) {
if ($atts['subject'] === 'Welcome Email') {
$atts['template_id'] = 'your-template-id';
$atts['variables'] = array(
'user_name' => 'John Doe',
'welcome_url' => 'https://example.com/welcome'
);
}
return $atts;
});// Schedule email for later
add_filter('unsend_wp_mail_process', function($atts) {
// Send email in 1 hour
$atts['scheduled_at'] = date('c', strtotime('+1 hour'));
return $atts;
});Access detailed email logs through Settings β Unsend Mailer β Email Logs:
- View recent email attempts
- Filter by status (sent, failed, pending)
- Export logs to CSV
- Clear old logs
Monitor your email performance:
- Total emails sent
- Success rate
- Failed deliveries
- Pending emails
The plugin includes comprehensive error handling:
- API connection failures
- Invalid email addresses
- Missing configuration
- Network timeouts
- Check API Key: Ensure it's valid and correctly entered
- Verify Domain: Your from email domain should be verified in Unsend
- Enable Logging: Check logs for specific error messages
- Test Connection: Use the built-in connection test
- Use Test Email: The Test Email feature always bypasses WordPress mail and uses Unsend directly - perfect for testing your configuration independently
- Enable Test Mode: Provides fallback during issues
- Check WordPress Logs: Review error logs for details
- Verify Settings: Ensure all required fields are filled
- Monitor Logs: Check for API timeouts
- Review Statistics: Look for patterns in failures
- Check Network: Ensure reliable connection to Unsend API
For support and bug reports:
- Check the Unsend Documentation
- Review plugin logs and statistics
- Contact support with specific error messages
- API keys are stored securely in WordPress options
- Keys are masked in the admin interface
- Validation prevents invalid key formats
- Email logs can be disabled if not needed
- Logs can be cleared automatically after specified periods
- No sensitive email content is stored by default
- Use HTTPS: Ensure your WordPress site uses SSL
- Regular Updates: Keep the plugin updated
- Monitor Logs: Regularly review email logs
- Test Configuration: Use test mode during development
- Backup Current Settings: Export existing configurations
- Install Unsend WP Mailer: Follow installation steps
- Configure Gradually: Start with test mode enabled
- Monitor Performance: Check logs and statistics
- Disable Old Plugin: Once satisfied with performance
- Install Plugin: No additional migration needed
- Configure Settings: Enter your Unsend credentials
- Test Thoroughly: Use the built-in test features
- Enable Override: Start using Unsend for all emails
- Use Verified Domains: Improves deliverability
- Monitor Success Rates: Adjust configuration as needed
- Regular Log Cleanup: Prevents database bloat
- Optimize From Headers: Use consistent sender information
- Regular Testing: Periodically test email functionality
- Monitor Statistics: Watch for declining performance
- Update Settings: Adjust based on email volume
- Review Logs: Identify and fix recurring issues
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This plugin is licensed under GPL v2 or later.
- Unsend for providing the email API
- WordPress community for development standards
- Contributors and testers
Made with β€οΈ for the WordPress community