https://github.com/zotonic/zotonic_mod_mailgun
Use mailgun for relaying emails.
https://github.com/zotonic/zotonic_mod_mailgun
Last synced: 3 months ago
JSON representation
Use mailgun for relaying emails.
- Host: GitHub
- URL: https://github.com/zotonic/zotonic_mod_mailgun
- Owner: zotonic
- License: apache-2.0
- Created: 2021-01-25T15:04:54.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-03T10:44:50.000Z (over 1 year ago)
- Last Synced: 2025-03-05T17:41:17.728Z (over 1 year ago)
- Language: Erlang
- Size: 39.1 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zotonic_mod_mailgun
Use [mailgun](https://mailgun.com/) for relaying emails.
## Functionality
This modules supports handling the webhook results from mailgun, when email is
sent via mailgun as the relay.
If the webhook is configured then the email results from mailgun are reported back
to the Zotonic system. This is done by calling `z_email_server:delivery_report/4`,
the `#email_failed` notification, or `m_email_status:mark_read/2`
`mod_mailgun` integrates into the email status module, copying clear and block
actions to mailgun.
## Configuration
There are four configurarion keys:
* `mod_mailgun.api_url` endpoint for mailgun API requests
* `mod_mailgun.domain` domain as configured in mailgun
* `mod_mailgun.api_key` key for signing API requests
* `mod_mailgun.webhook_secret` key for signing calls from mailgun to our webhook
Besides this the relay options for email sending need to be configured.
These can be configured in the admin via System > Mail settings. There will be
an additional panel to provide the Mailgun configurations.
## Webhook
Mailgun reports sending progress back to a webhook.
The webhook, to be configured at mailgun, is at: `/mailgun-webhook`
The config key `mod_mailgun.webhook_secret` MUST be configured for this to work.
If mailgun reports that the email is sent to the next MTA then in the email log it is shown as `relayed`.
## Dependencies
This module needs `mod_email_status`.