How to set Mailgun sending domain as root domain and not sub domain

Hi There! I am unsure if this is a Gravity Mailgun Addon support question or a Mailgun support question, so please let me know if this is the wrong place.

Mail gun says “We recommend using a subdomain with Mailgun, like “”. Using a subdomain you will be able to send emails from your root domain e.g. “you @”.” (had to add spaces round the @ because of community restrictions)

However, in the Gravity Forms Mailgun addon fires an error when trying to set from email with the root domains “From Email domain must be an active domain for the Europe region in Mailgun. You can learn more about verifying your domain in the Mailgun documentation.” (i.e. only let’s me enter the mailgun sub domain we set up on their portal).

When I use Zapier with Mailgun it allows the from email to be the root, which is why I thought it might be something to do with the Gravity Addon.

The problem I am trying to solve is just in case a user saves the from email and sends an email as this will fail (I have set all the reply-to fields to correct mailboxes)

Would appreciate some pointers.

Hi Nick, I will leave this open in case anyone in the community has run across this. I have not seen this issue before so I recommend opening a support ticket for the quickest attention:

I’ve come up against this as well and was curious. I’ve just considered this option and have not tested it – but I wonder if hooking into the filter gform_mailgun_email to modify the from address might work here. Something like:

add_filter( 'gform_mailgun_email', function( $mailgun_email, $email, $message_format, $notification, $entry ) {

    $mailgun_email['from'] = str_replace( '@mg.', '@', $mailgun_email['from'] );

    return $mailgun_email;

}, 10, 5 );

I’d be curious of your results if you give it a try.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.