Route invitation recipients only to mail delivery
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

This commit is contained in:
tegwick 2026-08-09 21:25:20 +02:00
parent bf03b3e82a
commit 6962ad63b4
3 changed files with 14 additions and 1 deletions

View file

@ -39,7 +39,13 @@ class HTTPOutboxDeliveryAdapter:
}
if self.mail_url and event.event_type in _MAIL_EVENTS:
self._post(self.mail_url, envelope)
self._post(self.event_url, envelope)
event_envelope = dict(envelope)
event_data = dict(envelope["data"])
if "primary_email" in event_data:
event_data["recipient_present"] = True
del event_data["primary_email"]
event_envelope["data"] = event_data
self._post(self.event_url, event_envelope)
def _post(self, url: str, envelope: dict[str, object]) -> None:
with urlopen(

View file

@ -2516,6 +2516,7 @@ class UserEngineService:
"family_scope_id": family_scope_id,
"application_id": application_id,
"role": role,
"primary_email": invitation.primary_email,
},
application_id=application_id,
)
@ -2574,6 +2575,7 @@ class UserEngineService:
"invitation_id": updated.invitation_id,
"user_id": updated.user_id,
"resend_count": updated.resend_count,
"primary_email": updated.primary_email,
},
application_id=updated.application_id,
)