WordPress

Replace WordPress wp_mail() with MailSetu for reliable transactional email.

Install the official plugin

The repo includes the official MailSetu WordPress plugin at `integrations/wordpress/mailsetu-wordpress.php`. Zip it as a plugin or drop it into your WordPress install.

bash
# Example local install
cp integrations/wordpress/mailsetu-wordpress.php wp-content/plugins/mailsetu/mailsetu-wordpress.php

Configure MailSetu in wp-admin

Activate the plugin, then open Settings → MailSetu and add your API key, from address, and from name. Use a sandbox key first if you want to verify setup before touching your production domain.

What the plugin does

It intercepts `wp_mail()`, forwards email payloads to MailSetu, and exposes a one-click test email flow from the settings page.

php
add_filter('pre_wp_mail', function ($return, $atts) {
    // The MailSetu plugin forwards the payload and stops default PHPMailer delivery.
    return $return;
}, 10, 2);

Recommended production flow

1. Use a sandbox key to verify the plugin install 2. Add and verify your sending domain in MailSetu 3. Switch the plugin to a live key 4. Send a test order email or password reset from wp-admin