Skip to content

Conversation

@d-mahi14
Copy link

@d-mahi14 d-mahi14 commented Jan 24, 2026

Fix #242
@Mariatta

This PR refactors the sponsorship email system so that emails are sent asynchronously using Celery instead of directly in the signals.

Changes included:

  1. Setup Celery task infrastructure in tasks.py for sponsorship emails.
  2. Moved sponsorship onboarding and progress update emails to Celery tasks:
    send_internal_sponsor_onboarding_email_task
    send_internal_sponsor_progress_update_email_task
  3. Updated settings to configure Django email backend for local testing (console backend).
  4. Added retry logic in tasks to handle temporary failures.
  5. Made ALLOWED_HOSTS environment variable safe for Docker and local development.

How to test

  1. Start docker: docker compose up --build
  2. Run a task manually: python manage.py shell
    from sponsorship.tasks import send_internal_sponsor_onboarding_email_task
    send_internal_sponsor_onboarding_email_task.delay(profile_id=1)
  3. Verify email output in MailDev console at http://localhost:1080

@netlify
Copy link

netlify bot commented Jan 24, 2026

Deploy Preview for pyladiescon-portal-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e0b5adb
🔍 Latest deploy log https://app.netlify.com/projects/pyladiescon-portal-docs/deploys/6974b346fcbfb300088fd2b2
😎 Deploy Preview https://deploy-preview-313--pyladiescon-portal-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@d-mahi14
Copy link
Author

@Mariatta can you please check this pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send emails as background task

1 participant