Description
SwiftTrap for Mailtrap replaces the default WordPress wp_mail() with the Mailtrap Send API.
Features:
- Send transactional and bulk emails via Mailtrap
- Automatic email categorization (welcome, password-reset, notification, etc.)
- Bulk stream routing for promotional emails
- Email logging with retention management
- Dashboard widget with account stats
- Test email from settings page
No SDK required — uses the WordPress HTTP API (wp_remote_post) for zero external dependencies.
Extensible via filters:
swifttrap_mailtrap_email_category— override email categoryswifttrap_mailtrap_use_bulk_stream— control bulk stream routingswifttrap_mailtrap_template— send via Mailtrap template (template_uuid)swifttrap_mailtrap_custom_variables— attach tracking metadata to emails
Installation
- Upload the
swifttrap-for-mailtrapfolder to/wp-content/plugins/ - Activate the plugin
- Go to Mailtrap Settings
- Enter your Mailtrap Send API token
- Configure sender email and name
FAQ
-
Where do I get my API token?
-
Log in to mailtrap.io, go to your sending domain, and copy the API token.
-
What data is sent externally?
-
This plugin sends email data (recipients, subject, body, attachments) to the Mailtrap API at
send.api.mailtrap.ioandbulk.api.mailtrap.io. Account stats are fetched frommailtrap.io/api/accounts. See Mailtrap Privacy Policy. -
Does the plugin work without Mailtrap?
-
When disabled or if the API token is empty, WordPress falls back to its default mail handler.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“SwiftTrap for Mailtrap” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “SwiftTrap for Mailtrap” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
2.2.0
- Replaced all file_get_contents/file_put_contents with WP_Filesystem API
- Fixed $_GET sanitization with proper wp_unslash() and phpcs annotations
- Improved PHPDoc headers across all files
- Better WordPress Coding Standards compliance
2.1.0
- Added sending domain verification status on Stats page
- Added suppression list (bounces, complaints, unsubscribes) on Stats page
- Added
swifttrap_mailtrap_templatefilter for Mailtrap template support - Added
swifttrap_mailtrap_custom_variablesfilter for email tracking metadata - Extracted reusable
swifttrap_mailtrap_get_account_id()with transient caching
2.0.0
- Removed Mailtrap SDK dependency — uses WordPress HTTP API directly
- Zero external dependencies, ~30 KB total plugin size
- Improved WP.org compliance
1.3.0
- Security: protected log directory from direct web access
- Added attachment size validation (25 MB limit)
- Added empty recipient validation
- Fixed timezone handling in log display
- Optimized email category computation
- Improved log file locking
