Skip to content

Implement Mailgun email event tracking with webhook handler and admin integration#681

Open
Copilot wants to merge 11 commits into
mainfrom
copilot/fix-7c3c4708-d676-4425-b6c7-bc003cda0a77
Open

Implement Mailgun email event tracking with webhook handler and admin integration#681
Copilot wants to merge 11 commits into
mainfrom
copilot/fix-7c3c4708-d676-4425-b6c7-bc003cda0a77

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 4, 2025

  • Create EmailEvent model to track email events from Mailgun webhooks
  • Add email tracking fields to Profile model for Mailgun events
  • Create mailgun_webhooks.py module to handle Mailgun webhook events
  • Add URL endpoint for Mailgun webhook
  • Update admin.py to display Mailgun email status
  • Add utility function to get email status for Mailgun events
  • Create database migration for new fields
  • Add tests for Mailgun webhook handling (7 tests, all passing)
  • Verify implementation works with existing Mailgun integration (all 209 tests pass)
  • Add comprehensive documentation
  • Fix linting issues (black, isort, flake8 all pass)

Summary

This PR implements a complete email event tracking system for Mailgun webhooks, mirroring the functionality of PR #569 for SendGrid. The implementation includes:

✅ Webhook handler with HMAC-SHA256 signature verification
✅ EmailEvent model and Profile extensions for tracking metrics
✅ Admin interface integration with color-coded status display
✅ Slack notifications for email events
✅ 7 comprehensive tests (100% pass rate)
✅ Complete documentation in docs/MAILGUN_EMAIL_TRACKING.md
✅ All linting checks passing (black, isort, flake8)

Fixed a minor formatting issue in web/admin.py where there was an extra backslash in the format_html string that was causing black to fail.

Original prompt

implement a simple email tracker similar to this @alphaonelabs/alphaonelabs-education-website/pull/569 however make it for mailgun


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 4, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits October 4, 2025 19:28
…tion

Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
… issue

Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
…tion

Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Copilot AI changed the title [WIP] implement a simple email tracker similar to this @alphaonelabs/alphaonelabs-education-website/pull/569 however make it for mailgun Implement Mailgun email event tracking with webhook handler and admin integration Oct 4, 2025
Copilot AI requested a review from A1L13N October 4, 2025 19:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 4, 2025

🚨 Missing Open Issue Link

This pull request does not reference any open GitHub issue via the Development section.

PRs must be linked to an open issue using GitHub’s "Development" section (on the right sidebar).

How to fix this:

  • Go to the PR page.
  • Use the "Link issue" option in the Development section.
  • Select an appropriate open issue.

This PR will be automatically closed. You can reopen it after linking an open issue.

Thank you!

@github-actions github-actions Bot closed this Oct 4, 2025
@A1L13N A1L13N added the d4 label Oct 4, 2025
@A1L13N A1L13N reopened this Oct 4, 2025
@A1L13N A1L13N marked this pull request as ready for review October 4, 2025 23:06
@A1L13N
Copy link
Copy Markdown
Contributor

A1L13N commented Oct 5, 2025

@copilot Fix lints

… string

Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 5, 2025

@copilot Fix lints

Fixed in 9a5011c - removed extra backslash in format_html string in web/admin.py. All linting checks now pass (black, isort, flake8).

Copilot AI requested a review from A1L13N October 5, 2025 06:54
@A1L13N A1L13N removed the d5 label Dec 14, 2025
@github-actions github-actions Bot added the files-changed: 8 PR changes 8 files label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

files-changed: 8 PR changes 8 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants