Linux 软件免费装
Banner图

SwiftTrap for Mailtrap

开发者 simmotorlp
更新时间 2026年11月26日 16:01
PHP版本: 8.0 及以上
WordPress版本: 7.2
版权: GPLv2 or later
版权网址: 版权信息

标签

wp-mail mailtrap email-log transactional-email email-api

下载

2.2.2 2.4.2 3.0.4 3.1.0 2.2.0 2.3.0 2.4.0 2.4.1 3.0.0 3.0.1 3.0.2 3.0.3

详情介绍:

SwiftTrap is a drop-in replacement for wp_mail() that routes WordPress email through the Mailtrap Email Sending API instead of SMTP. It is purpose-built for Mailtrap — not a generic SMTP plugin with a Mailtrap preset — so it exposes Mailtrap-native features that SMTP cannot: bulk vs transactional stream routing, email categories, custom variables for tracking, suppression lists, and domain verification status. Why HTTP API instead of SMTP? Why SwiftTrap and not WP Mail SMTP / Post SMTP Features Extensible via filters Privacy This plugin sends email payloads (recipients, subject, body, attachments) to the Mailtrap API at send.api.mailtrap.io and bulk.api.mailtrap.io. Account stats and email logs are fetched from mailtrap.io/api/accounts and mailtrap.io/api/email_logs. See the Mailtrap Privacy Policy. No data is sent anywhere else.

安装:

  1. Install from Plugins → Add New and search for SwiftTrap for Mailtrap, or upload the swifttrap-for-mailtrap folder to /wp-content/plugins/.
  2. Activate the plugin.
  3. Go to Mailtrap → Settings.
  4. Paste your Mailtrap API token (Mailtrap → Settings → API Tokens) and click Check connection.
  5. Set the From email (an address on a domain you verified in Mailtrap) and the From name. Save.
  6. Click Send Test Email to verify delivery.
  7. Sending a newsletter from this site? Tick Send newsletters through the bulk stream.

屏幕截图:

  • Stats page — sending domain verification status and suppression list (bounces, complaints, unsubscribes).
  • Email log — live Mailtrap API data with filters and pagination.
  • Dashboard widget showing integration status, sender, and quick links to Stats and Settings.
  • Test email confirmation.

升级注意事项:

3.1.1 Compatibility update for WordPress 7.2 and PHP 8.6. No changes to how emails are sent. 3.1.0 Newsletters can now go through Mailtrap's bulk stream with one checkbox. Fixes settings that could not be switched off, wp_mail() reporting success for emails that were not sent, and From filters. Recommended. 3.0.4 Fixes the plain-text part of HTML emails: links with parameters no longer break, and link URLs are kept. Recommended. 3.0.3 Adds a one-time, dismissible review request (shown a week after your first email is sent). No changes to email delivery. 3.0.2 Compatibility release: tested with WordPress 7.1. No functional changes. 3.0.1 Important fix: webhook delivery-tracking events from Mailtrap were being rejected due to a signature-verification mismatch and have never been processed since 2.4.0. Update if you use the webhook integration. 2.4.0 Upgrades WordPress plugin to 2.4.0, introducing delivery tracking webhooks, suppression management, graceful native fallback, enhanced logs UI with CSV export, WP-CLI commands, and a WordPress Site Health check. 2.3.0 Minor reliability release: automatic sending retries on transient API errors, cron-based log cleanup, and modern PHP 8 updates. 2.2.2 Plugin URI now points to the dedicated landing page on plugins.symonov.com. No code changes. 2.2.1 Documentation-only release. Refreshed readme and confirmed compatibility with WordPress 7.0. 2.2.0 WordPress Coding Standards pass — WP_Filesystem API, hardened input sanitization, and improved PHPDoc. No configuration changes required.

常见问题:

Why use SwiftTrap instead of WP Mail SMTP or Post SMTP with Mailtrap credentials?

Generic mailer plugins treat Mailtrap as one provider among many: through SMTP credentials, or through the transactional API only. SwiftTrap is built for Mailtrap alone and uses what is specific to it: bulk vs transactional stream routing (including automatic routing of newsletters), categories, custom tracking variables, template UUIDs, and live suppression-list visibility. Use SwiftTrap if you want Mailtrap-native behavior; use a generic SMTP plugin if you want a one-config-fits-all-providers setup.

Does it support Mailtrap email templates?

Yes — use the swifttrap_mailtrap_template filter to send via a template_uuid. The template variables can be passed through Mailtrap's standard template-variables payload.

How do I send my newsletter through the bulk stream and everything else through the transactional stream?

Go to Mailtrap → Settings and tick Send newsletters through the bulk stream. Campaign emails sent by Newsletter (The Newsletter Plugin), FluentCRM, Icegram Express and Groundhogg are then recognized and sent through bulk.api.mailtrap.io; password resets, orders, form notifications, signup confirmations and all other email keep using send.api.mailtrap.io. Nothing has to be configured in the newsletter plugin — leave it on its default "send through WordPress" delivery. The same API token is used for both streams. MailPoet is the exception: it sends with its own mailer and never passes through wp_mail(), so no wp_mail() plugin can route it.

How does bulk stream routing work?

Strongest first: the swifttrap_mailtrap_use_bulk_stream filter; the X-SwiftTrap-Stream: bulk (or transactional) header on a wp_mail() call; newsletter plugin detection (when switched on); the category table on the settings screen, where the promotional category goes to the bulk stream by default. Everything else goes to send.api.mailtrap.io. Mailtrap keeps unsubscribes and bounces separately for each stream, and so does the plugin: somebody who unsubscribed from your newsletter still receives a password reset.

Where do I get my API token?

Log in to mailtrap.io, open your sending domain, go to API Tokens, and create a token with sending permissions. After saving, the token is never displayed again. To keep it out of the database, add define( 'SWIFTTRAP_MAILTRAP_TOKEN', 'your-token' ); to wp-config.php instead.

What happens if I disable the plugin or remove the token?

WordPress falls back to its default wp_mail() handler. No emails are silently dropped.

What happens if Mailtrap refuses a message or cannot be reached?

The plugin retries briefly, then reports the failure to WordPress (wp_mail_failed, with the reason Mailtrap gave). With Use the default WordPress mailer as a backup ticked (the default) the message is then handed to the default mailer; untick it if email must never leave through your web host — wp_mail() then returns false.

Does the plugin require the Mailtrap PHP SDK?

No. SwiftTrap calls the Mailtrap REST API directly via the WordPress HTTP API. Total plugin size is around 30 KB.

What data is sent externally?

Email data (recipients, subject, body, attachments) goes to send.api.mailtrap.io and bulk.api.mailtrap.io. Account stats are fetched from mailtrap.io/api/accounts. See the Mailtrap Privacy Policy.

Is there an attachment size limit?

The plugin refuses attachments above the size you set (1–25 MB per file, 25 by default). Mailtrap itself limits the whole message, attachments included, to 10 MB by default (more on request on higher plans), so lower the setting if your plan has the default limit.

更新日志:

3.1.1 3.1.0 3.0.4 3.0.3 3.0.2 3.0.1 3.0.0 2.4.2 2.4.1 2.4.0 2.3.0 2.2.2 2.2.1 2.2.0 2.1.0 2.0.0 1.3.0