feat(email): generic webhook for all notification emails, hide SMTP UI
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
- Renamed the password-setup webhook (email_webhook.*, /system/email-webhook-config) and made it the single transport for all notification emails. - New webhook_email_service.py shared by password_setup_service and notification_service. - Wired test validated/rejected, campaign completed, and new-MITRE-technique notifications through the webhook (previously dead SMTP code, never triggered). - Added POST /system/email-webhook-test to send a real test email. - Hid the Email/SMTP settings tab from the UI (SMTP code kept intact, unused). - Redact email_webhook.api_key on config export.
This commit is contained in:
@@ -391,5 +391,18 @@ def sync_mitre(db: Session) -> dict:
|
||||
# Commit all pending changes to the database
|
||||
db.commit()
|
||||
|
||||
if created > 0:
|
||||
from app.services.notification_service import notify_all_users_by_email
|
||||
|
||||
notify_all_users_by_email(
|
||||
db,
|
||||
preference_key="email_on_new_mitre_techniques",
|
||||
subject=f"MITRE ATT&CK Updated: {created} new techniques",
|
||||
message=(
|
||||
f"{created} new techniques were added and {updated} were "
|
||||
"updated in the MITRE ATT&CK catalog."
|
||||
),
|
||||
)
|
||||
|
||||
# Return summary
|
||||
return summary
|
||||
|
||||
Reference in New Issue
Block a user