Skip to content

Add send_test_email management command #427

@gaidheal1

Description

@gaidheal1

Add a management command send_test_email to verify the transactional email pipeline is working end-to-end in any environment.

Motivation

There's no easy way to confirm that email sending actually works in a given environment (staging, production) without triggering a real user action like registration. A dedicated command makes smoke-testing the email config fast and safe.

Behaviour

python manage.py send_test_email <recipient>
  • Sends a simple "test email" to the given address using whatever email backend is configured (EMAIL_BACKEND, EMAIL_HOST, etc.)
  • Prints the outcome to stdout: success with delivery details, or a clear error message on failure
  • Should go through the same code path as real transactional emails (i.e. not bypass Celery if email sending is async)

Acceptance criteria

  • Command exists at users/management/commands/send_test_email.py (or api/ if more appropriate)
  • Accepts a single positional argument: recipient email address
  • Works in Docker: docker compose run --rm web python manage.py send_test_email test@example.com
  • Works on Render via the shell tab
  • Fails clearly (non-zero exit, readable error) if the email backend is misconfigured

Parent

Part of #426

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: playersPlayer profiles, settings, and user-facing account features
    No fields configured for Feature.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions