Mailgun transport for the Grav Email plugin (Symfony Mailer). Supports Mailgun API, HTTPS and SMTP transports, including region selection (us/eu).
From your Grav root:
bin/gpm install email-mailgunor install from the Admin panel via Plugins → Add.
Copy the default config to user/config/plugins/email-mailgun.yaml and adjust:
enabled: true
transport: api # api (recommended), https, or smtp
api_key: YOUR_KEY # API/HTTPS only
domain: yourdomain.tld # API/HTTPS only
region: us # us or eu (matches your Mailgun domain region)
username: # SMTP only
password: # SMTP onlyAdmin UI exposes the same fields, including the region selector.
In user/config/plugins/email.yaml:
mailer:
engine: mailgunAlso set your from/to addresses there as usual.
- API vs HTTPS vs SMTP:
apiis fastest and supports modern features.httpsuses basic HTTP auth.smtpworks if HTTP is blocked. - Region: choose
euif your Mailgun domain lives in the EU region; otherwise leaveus. The DSN is generated with?region=<us|eu>. - Debugging: enable
plugins.email.debug: trueinemail.yamlto log the full transport debug output tologs/email.log. - Validation: API/HTTPS require
api_keyanddomain; SMTP requiresusernameandpassword. Missing fields raise a clear error during transport creation.
- Mailgun API docs: https://documentation.mailgun.com/en/latest/api-intro.html
- Symfony Mailgun mailer bridge: https://github.com/symfony/mailgun-mailer