跳至主要內容
WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

SwiftTrap for Mailtrap

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

SwiftTrap for Mailtrap

由 SYMONOV 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

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?

  • Lower latency — one HTTPS call per message, no MAIL FROM / RCPT TO / DATA round-trips.
  • Better deliverability — Mailtrap routes API messages through its dedicated transactional and bulk streams; SMTP doesn’t expose stream selection.
  • Native categories — every email is automatically categorized (welcome, password-reset, notification, marketing, etc.) so you can filter and report on them in Mailtrap.
  • No firewall headaches — port 587/465 blocked? API works over standard HTTPS 443.

Why SwiftTrap and not WP Mail SMTP / Post SMTP

  • Generic SMTP plugins use Mailtrap’s SMTP credentials and lose every Mailtrap-only feature.
  • SwiftTrap calls send.api.mailtrap.io for transactional mail and bulk.api.mailtrap.io for bulk mail — automatically, based on category or via filter.
  • No Mailtrap PHP SDK required. Plugin is ~30 KB total and uses only the WordPress HTTP API (wp_remote_post).
  • Stats page shows your sending domain verification status and the live suppression list (bounces, complaints, unsubscribes).

Features

  • Drop-in replacement for wp_mail() — works with Contact Form 7, WooCommerce, Gravity Forms, and any plugin that uses WordPress mail.
  • Automatic email categorization (welcome, password-reset, notification, marketing, etc.).
  • Bulk stream routing for promotional emails; transactional stream for everything else.
  • Email log with retention management — see what was sent, when, and to whom.
  • Dashboard widget — at-a-glance integration status and quick links to Stats and Settings.
  • Stats page: sending domain verification status + suppression list.
  • Test email button on the settings page.
  • Mailtrap template support via template_uuid.
  • Falls back to default WordPress mail handler when disabled or token is empty.

Extensible via filters

  • swifttrap_mailtrap_email_category — override the auto-detected email category.
  • swifttrap_mailtrap_use_bulk_stream — force a message into the bulk or transactional stream.
  • swifttrap_mailtrap_template — send via a Mailtrap template by template_uuid.
  • swifttrap_mailtrap_custom_variables — attach tracking metadata to outgoing emails.

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 are fetched from mailtrap.io/api/accounts. See the Mailtrap Privacy Policy. No data is sent anywhere else.

螢幕擷圖

  • Settings page — API token, verified sender, stream routing.
  • Stats page — sending domain verification status and suppression list (bounces, complaints, unsubscribes).
  • Email log with retention controls.
  • Dashboard widget showing integration status, sender, and quick links to Stats and Settings.
  • Test email confirmation.

安裝方式

  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 Send API token (Mailtrap dashboard → Sending Domains → API Tokens).
  5. Set your verified sender email and name.
  6. Click Send test email to verify delivery.

常見問題集

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

WP Mail SMTP and Post SMTP route through Mailtrap’s SMTP gateway and treat Mailtrap as just another SMTP host. SwiftTrap uses Mailtrap’s HTTP Send API, which exposes features SMTP cannot: bulk vs transactional stream routing, 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 does bulk stream routing work?

By default, marketing/promotional categories are routed to bulk.api.mailtrap.io and everything else to send.api.mailtrap.io. Override per-message with the swifttrap_mailtrap_use_bulk_stream filter — useful for batch newsletters from a custom plugin.

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.

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.

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?

Yes — 25 MB per email (matches Mailtrap’s API limit).

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈SwiftTrap for Mailtrap〉的開發相關工作。

參與者
  • SYMONOV

將〈SwiftTrap for Mailtrap〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

2.2.2

  • Plugin URI: now points to the dedicated landing page at https://plugins.symonov.com/swifttrap-for-mailtrap/
  • No code or behavior changes

2.2.1

  • Readme: USP-first rewrite emphasizing Mailtrap Email API (vs SMTP) and bulk/transactional stream routing
  • Tags: replaced email/mail/smtp with targeted mailtrap, transactional-email, email-api, wp-mail, email-log
  • FAQ: added comparison with WP Mail SMTP / Post SMTP, Mailtrap template support, and bulk stream routing
  • Tested up to WordPress 6.9.4

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_template filter for Mailtrap template support
  • Added swifttrap_mailtrap_custom_variables filter 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

中繼資料

  • 版本 2.2.2
  • 最後更新 2 週前
  • 啟用安裝數 少於 10 次
  • WordPress 版本需求 6.0 或更新版本
  • 已測試相容的 WordPress 版本 6.9.4
  • PHP 版本需求 8.0 或更新版本
  • 語言
    English (US)
  • 標籤:
    Email APIemail logmailtraptransactional emailwp-mail
  • 進階檢視

評分

這個項目尚無任何評論記錄。

Your review

查看全部使用者評論

參與者

  • SYMONOV

技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

檢視技術支援論壇

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Five for the Future
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Taiwan 正體中文

  • 查看我們的 X (之前的 Twitter) 帳號
  • 造訪我們的 Bluesky 帳號
  • 造訪我們的 Mastodon 帳號
  • 造訪我們的 Threads 帳號
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • 造訪我們的 TikTok 帳號
  • Visit our YouTube channel
  • 造訪我們的 Tumblr 帳號
程式碼,如詩
The WordPress® trademark is the intellectual property of the WordPress Foundation.