Add webhook trigger

This commit is contained in:
KenwoodFox
2025-12-10 22:15:06 -05:00
parent d9208e277c
commit 3e4022e1d5
7 changed files with 340 additions and 14 deletions

View File

@@ -91,15 +91,17 @@ def submit_quote(request):
yield send_progress_update(3, "Files saved...", 50)
# Step 4: Send emails
# Step 4: Send webook if config
from quotes.discord_utils import send_discord_webhook
yield send_progress_update(4, "Triggering hooks...", 60)
send_discord_webhook(submission)
# Step 5: Send emails
from quotes.email_utils import send_submission_emails
yield send_progress_update(4, "Sending notification email...", 70)
yield send_progress_update(4, "Sending emails...", 70)
owner_sent, submitter_sent = send_submission_emails(submission)
time.sleep(0.3)
yield send_progress_update(4, "Sending confirmation email...", 75)
time.sleep(0.3)
# Verify emails were sent
if not owner_sent and getattr(settings, "OWNER_EMAIL", ""):
@@ -113,6 +115,7 @@ def submit_quote(request):
"warning", "Warning: Confirmation email may not have been sent", 75
)
time.sleep(0.1)
# Complete
yield send_progress_update(
5,