Unify SMTP2GO email and SMS into one webhook URL.
Deploy Beta / unit-tests (push) Successful in 13s
Deploy Beta / docker (push) Successful in 18s
Deploy Beta / deploy-beta (push) Successful in 1m38s

Classify payloads on /webhooks/smtp2go/ so one SMTP2GO webhook covers both channels under the 10-webhook limit; keep /email/ and /sms/ as aliases and harden SMS event matching.
This commit is contained in:
2026-08-10 11:06:37 -05:00
parent f7f3174e1c
commit ee28dcabab
7 changed files with 472 additions and 115 deletions
+6 -2
View File
@@ -37,9 +37,13 @@ def send_sms(message) -> str:
)
response.raise_for_status()
data = response.json() if response.content else {}
# SMTP2GO returns varying shapes; store a useful id when present.
# Prefer SMS id fields used on webhooks (`message_id` / `sms_id`).
nested = data.get("data") if isinstance(data.get("data"), dict) else {}
return str(
data.get("data", {}).get("sms_id")
nested.get("sms_id")
or nested.get("message_id")
or data.get("sms_id")
or data.get("message_id")
or data.get("request_id")
or f"sms-{message.pk}"
)