Add email notification support for workflow events - #114
Closed
kael-developer[bot] wants to merge 1 commit into
Closed
Add email notification support for workflow events#114kael-developer[bot] wants to merge 1 commit into
kael-developer[bot] wants to merge 1 commit into
Conversation
Implemented by Kael AI Agent
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.
Why
Problem
Only Slack/Webhook notifications exist; organizations that rely on email alerts cannot be notified when a workflow succeeds, fails, or is retried.
Solution
Introduce configurable email notifications using a background worker (Celery) that sends templated messages via SMTP when specific workflow events occur.
Value
Operators receive direct email alerts, increasing visibility of critical failures and enabling quicker response times for teams without Slack.
What changed
Files created:
celeryandaiosmtplibdependencies.send_email(to: str, subject: str, body: str)usingaiosmtplib.notify_workflow_event(event_type: str, workflow_id: str, recipient: str)task that renders Jinja2 templates and callssend_email.sdlc notify-test --email you@example.comthat sends a test email viasend_email.send_emailand asserts correct call on a simulated failure event.Files modified:
SMTP_HOST,SMTP_PORT,SMTP_USERNAME,SMTP_PASSWORD,DEFAULT_EMAIL_RECIPIENTS) with environment variable loading.notify_workflow_eventCelery task forworkflow_success,workflow_failure, andworkflow_retryevents, using recipients from config.notificationsCLI group.workerservice that runs the Celery worker using the same image.Logic implemented:
Build verified:
pytest -q tests/integration/test_email_notifications.py→ exit code 0, test passed.Acceptance criteria
send_emailis invoked with a subject containing the workflow ID and status. 3. The CLIsdlc notify-testsends a test email to the supplied address and prints success/failure. 4. Integration test validates that the email function is called with correct parameters without sending real mail. 5. No existing Slack/webhook functionality is broken (all previous tests still pass).Closes #111
🤖 Implemented automatically by Kael AI Agent