Mailgun for Groundhogg
Integration between Mailgun and Groundhogg for tracking email events
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/odzk/mailgun-gh/archive/refs/heads/master.zipReadme
Mailgun for Groundhogg
A WordPress plugin that integrates Mailgun webhooks with Groundhogg CRM to track email events like bounces, spam complaints, and unsubscribes.
Features
- Accepts and processes webhooks from Mailgun
- Stores email events in a custom database table
- Displays events in an admin dashboard
- Provides a settings page to configure the integration
- Automatically tags contacts in Groundhogg based on email events
- Shows a summary dashboard widget
Installation
- Download the plugin zip file
- Go to WordPress Admin > Plugins > Add New > Upload Plugin
- Upload the zip file and activate the plugin
- Make sure Groundhogg is active
Configuration
- Navigate to Groundhogg > Mailgun Settings
- Enter your Mailgun API key
- Copy the webhook URL
- Log in to your Mailgun account
- Go to Sending > Webhooks
- Add the webhook URL for each event type you want to track:
- Bounced
- Complained (Spam)
- Unsubscribed
- (Optional) Delivered, Opened, Clicked, Failed
Usage
Once configured, the plugin will automatically:
- Receive webhook events from Mailgun
- Store events in the database
- Tag contacts in Groundhogg based on events:
email-bouncedfor bounced emailsspam-complaintfor spam complaintsunsubscribed-via-mailgunfor unsubscribes
You can view all events by going to Groundhogg > Mailgun Events.
Dashboard
The plugin adds a dashboard widget that shows:
- Count of bounces, complaints, and unsubscribes
- Recent email events
- Link to view all events
File Structure
mailgun-groundhogg/
├── assets/
│ ├── css/
│ │ └── admin.css
│ └── js/
│ └── admin.js
├── includes/
│ ├── class-mailgun-gh.php
│ ├── class-webhook-handler.php
│ ├── class-events-table.php
│ ├── class-settings.php
│ ├── class-admin.php
│ └── class-dashboard.php
├── languages/
│ └── mailgun-groundhogg.pot
└── mailgun-groundhogg.php
Developers
Hooks
The plugin provides the following action hook for developers:
do_action('mailgun_gh_process_event', $event_type, $recipient, $data, $contact);
This is triggered whenever a Mailgun event is processed, allowing you to add custom logic.
Example: Custom Event Processing
add_action('mailgun_gh_process_event', 'my_custom_mailgun_processing', 10, 4);
function my_custom_mailgun_processing($event_type, $recipient, $data, $contact) {
// Your custom logic here
if ($event_type === 'bounced' && $contact) {
// Do something with the contact
$contact->update_meta('last_bounce_date', current_time('mysql'));
}
}
Requirements
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Groundhogg plugin
License
GPL v2 or later
Support
For support, please contact the plugin author.