[Fix #4675] Implement feature to send paid plan details to challenge hosts when requested for approval#4701
Merged
RishabhJain2018 merged 28 commits intoCloud-CV:masterfrom Jul 31, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4701 +/- ##
==========================================
+ Coverage 72.93% 76.91% +3.98%
==========================================
Files 83 21 -62
Lines 5368 3608 -1760
==========================================
- Hits 3915 2775 -1140
+ Misses 1453 833 -620 see 75 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
RishabhJain2018
requested changes
Jul 5, 2025
Member
RishabhJain2018
left a comment
There was a problem hiding this comment.
I am working on the email plan email. Will send it to you soon!
| "challenge_id": challenge.pk, | ||
| "host_team_name": challenge.creator.team_name, | ||
| "support_email": getattr( | ||
| settings, "CLOUDCV_TEAM_EMAIL", "team@cloudcv.org" |
Member
There was a problem hiding this comment.
Please change it to team@eval.ai
| subject=subject, | ||
| body="Please view this email in HTML format.", # Plain text fallback | ||
| from_email=getattr( | ||
| settings, "CLOUDCV_TEAM_EMAIL", "team@cloudcv.org" |
Member
|
Hey @Zahed-Riyaz , Please update the email template. Please check your DM. |
RishabhJain2018
approved these changes
Jul 31, 2025
RishabhJain2018
pushed a commit
that referenced
this pull request
Mar 2, 2026
…hosts when requested for approval (#4701) * implement email logic * Add templates + refine email logic * Add tests for paid plans email feature * Omit debugs * Update utils.ppy * implement email logic * Add templates + refine email logic * Add tests for paid plans email feature * Omit debugs * Update utils.ppy * Refine tests * Modify tests * remove unnecessary imports * Update docker-compose.yml * Handle undefined variables * Update test_views.py * Update env variables and tests * Update env variables and tests * Update email * fix isort checks * Resolve Flake8 checks * Update email template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a fix for #4675. It implements the following :
New email-dispatch utility
•
challenges/utils.pynow containssend_subscription_plans_email(challenge)and helpersend_emails(...).• Generates a personalised “subscription plans” message for every host of a challenge, supports plain-text+HTML (via
EmailMultiAlternatives) and graceful error / logging paths.• Falls back to sensible defaults if optional settings (e.g. hostname, support address) are missing.
HTML placeholder template for the paid plans email.
Approval workflow extended
•
apps/challenges/views.request_challenge_approval_by_pk– on success, calls
send_subscription_plans_email.Robust test-suite for the feature
a.
tests/unit/challenges/test_utils.py– 12 new cases covering:• successful sends, per-recipient delivery, HTML body attach, unicode titles, image/no-image paths, SMTP or template exceptions, etc.
b.
tests/unit/challenges/test_views.py– new API tests inChallengeSendApprovalRequestTestvalidating that:• email fires only when submissions are complete & requester is a host,
• failures are tolerated,
• non-hosts can’t trigger it,
Here's a video showcasing the email with a dummy template : (temporarily removed phase submission conditions for the approval to get through, they were restored after.)
test_email.mp4