This is a Mailgun integration plugin to allow sending email through Mailgun by HTTP API or SMTP
Mailgun is the email automation engine trusted by over 10,000 website and application developers for sending, receiving and tracking emails. By taking advantage of Mailgun’s powerful email APIs, developers can spend more time building awesome websites and less time fighting with email servers. Mailgun supports all of the most popular languages including PHP, Ruby, Python, C# and Java.
One particularly useful feature of this plugin is that it provides you with a way to send email when the server you are on does not support SMTP or where outbound SMTP is restricted since the plug-in uses the Mailgun HTTP API for sending email by default. All you need to use the plugin is a Mailgun account. Mailgun has a free account that lets you send up to 200 emails per day, which is great for testing. Paid subscriptions are available for increased limits.
The latest version of this plugin now supports regions. Select either U.S./North America or Europe to choose the API endpoint from which you will send email.
The current version of this plugin only handles sending emails, tracking and tagging and list subscription.
Screenshots
Configuration options for using the Mailgun HTTP API
Configuration options for using the Mailgun SMTP servers
FAQ
- Testing the configuration fails when using the HTTP API
Your web server may not allow outbound HTTP connections. Set Use HTTP API
to “No”, and fill out the configuration options to SMTP and test again.
- Testing the configuration fails when using SMTP
Your web server may not allow outbound SMTP connections on port 465 for secure connections or 587 for unsecured connections. Try changing Use Secure SMTP
to “No” or “Yes” depending on your current configuration and testing again. If both fail, try setting Use HTTP API
to “Yes” and testing again.
If you have to use SMTP and something is still going horribly wrong, enable debug mode in WordPress and also add the MG_DEBUG_SMTP
constant to your wp-config.php
, like so:
define( 'MG_DEBUG_SMTP', true );
- Can this be configured globally for WordPress Multisite?
Yes, using the following constants that can be placed in wp-config.php:
MAILGUN_REGION Type: string Choices: 'us' or 'eu'
ex. define('MAILGUN_REGION', 'us');
MAILGUN_USEAPI Type: boolean Choices: '0' or '1' (0 = false/no)
MAILGUN_APIKEY Type: string
MAILGUN_DOMAIN Type: string
MAILGUN_USERNAME Type: string
MAILGUN_PASSWORD Type: string
MAILGUN_SECURE Type: boolean Choices: '0' or '1' (0 = false/no)
MAILGUN_SECTYPE Type: string Choices: 'ssl' or 'tls'
MAILGUN_FROM_NAME Type: string
MAILGUN_FROM_ADDRESS Type: string
MAILGUN_TRACK_CLICKS Type: string Choices: 'yes' or 'no'
MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no'
-
What hooks are available for use with other plugins?
mg_use_recipient_vars_syntax
Mutates messages to use recipient variables syntax – see
https://documentation.mailgun.com/user_manual.html#batch-sending for more info.
Should accept a list of To
addresses.
Should only return true
or false
.
mg_mutate_message_body
Allows an external plugin to mutate the message body before sending.
Should accept an array, $body
.
Should return a new array to replace $body
.
mg_mutate_attachments
Allows an external plugin to mutate the attachments on the message before
sending.
Should accept an array, $attachments
.
Should return a new array to replace $attachments
.
-
What hooks are available for use with other plugins?
mg_use_recipient_vars_syntax
Mutates messages to use recipient variables syntax – see
https://documentation.mailgun.com/en/latest/user_manual.html#batch-sending for more info.
Should accept a list of To
addresses.
Should only return true
or false
.
mg_mutate_message_body
Allows an external plugin to mutate the message body before sending.
Should accept an array, $body
.
Should return a new array to replace $body
.
mg_mutate_attachments
Allows an external plugin to mutate the attachments on the message before
sending.
Should accept an array, $attachments
.
Should return a new array to replace $attachments
.
ChangeLog