WordPress Plugin
Route every WordPress and WooCommerce email through MailCraft with a plugin you can set up in minutes.
The MailCraft plugin replaces WordPress’ wp_mail() transport, so every email — password resets, WooCommerce orders, contact forms (Contact Form 7, WPForms, …) — goes through the MailCraft API, is DKIM-signed for your domain and shows up in your delivery logs.
Requirements: WordPress 5.7+ and PHP 7.4+.
Before you start
- Add and verify a sending domain, e.g.
mail.example.com. - Create an API key under Mail Agents → API Keys with the
email:sendscope.
Install
- Get the plugin’s
mailcraft.zip(contact support if you do not have it yet). - In WordPress go to Plugins → Add New → Upload Plugin, choose the file and click Install Now.
- Click Activate.
Configure
Open Settings → MailCraft.
| Option | What it does |
|---|---|
| Enable | Send wp_mail() through MailCraft |
| API key | Paste your maas_live_… key. It is never displayed again after saving |
| From email | Must be on a verified domain, e.g. no-reply@mail.example.com |
| From name | e.g. your shop or site name |
| Force From | Always use the From above, even when another plugin (e.g. WooCommerce) sets its own |
| If MailCraft fails | Fall back to the default WordPress mailer (default) or do not fall back and let wp_mail() return false |
Click Save settings, then Send test email. If it fails, the reason is shown under Last error at the bottom of the page.
Keep the key in wp-config.php (recommended)
To keep the key out of the database, add this to wp-config.php; the API key field is then locked:
define( 'MAILCRAFT_API_KEY', 'maas_live_xxxxxxxxxxxx' );
When stored in the database, the key is saved with autoload disabled so it is not loaded on every page view.
What is supported
- HTML and plain-text email, Cc, Bcc, Reply-To and custom headers
- Attachments (sent base64-encoded)
- The standard
wp_mail_from,wp_mail_from_nameandwp_mail_content_typefilters - The core
wp_mail_succeededandwp_mail_failedactions - One retry on 429 / 5xx with the same
Idempotency-Key, so nothing is sent twice - Thai admin translation
Customise the request
The mailcraft_payload filter lets you change the body sent to POST /v1.1/email:
add_filter( 'mailcraft_payload', function ( $payload, $atts ) {
$payload['mime_headers']['X-Site'] = 'shop-th';
return $payload;
}, 10, 2 );
FAQ
What happens when I run out of credits? The API answers 402 insufficient_credits. With fallback enabled WordPress sends the email the default way; otherwise wp_mail() returns false and the error is shown on the settings page.
Does it work alongside an SMTP plugin? Yes. With fallback enabled, the SMTP plugin becomes the fallback transport. If you would rather use MailCraft’s SMTP directly, see SMTP integration.