-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: customer io email support #28578
feat: customer io email support #28578
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces Customer.io as a new email service provider, replacing Mailgun for transactional emails, with implementation focused on API integration and backward compatibility with existing SMTP functionality.
- Added Customer.io API integration in
/posthog/email.py
with new_send_via_http
function and service availability checks - Implemented Decimal to float conversion in
/posthog/email.py
for proper JSON serialization in Customer.io payload - Added
CUSTOMER_IO_API_KEY
configuration in/ee/settings.py
for enterprise deployment support - Added comprehensive HTTP-based email sending tests in
/posthog/test/test_email.py
covering API authentication and data handling - Maintained backward compatibility by preserving SMTP functionality with a
use_http
toggle flag
3 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be great to have everything in Customer.io!
Left a couple questions about their API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📬
5a021bb
to
1fbc2a0
Compare
@joshsny I made a bunch of updates here, could I grab another review? I wanted to add backup templates for self hosters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome 🚀
Co-authored-by: Joshua Snyder <[email protected]>
Co-authored-by: Joshua Snyder <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Changes
We're consolidating email sending into customer.io so moving off Mailgun. Billing emails are already using this and it's working well. This is adding the basic setup.
This is also implementing the first 3 emails for 2FA auth and adding backup HTML SMTP email templates.
Waiting on https://github.com/PostHog/charts/pull/3393
RFC for more info: https://github.com/PostHog/product-internal/blob/main/requests-for-comments/2024-12-12-posthog-emails-customer-io.md
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
Built this as an alternative to the existing STMP
How did you test this code?
Added a few unit tests