fix(visitor_mailer): follow the host reassigned on an event (PPT-2375) - #621
Draft
chillfox wants to merge 1 commit into
Draft
fix(visitor_mailer): follow the host reassigned on an event (PPT-2375)#621chillfox wants to merge 1 commit into
chillfox wants to merge 1 commit into
Conversation
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.
Scenario 1 of PPT-2375: "the 'Booking Host Changed' notification should be sent to the original host. Instead the new host is receiving the Visitor Invite Confirmation email." — the mailer half.
The reassignment itself is PlaceOS/staff-api#383, which makes
hoston every signal mean who is hosting and reports the mailbox owner separately asorganiser_email. With that, the mailer's existing logic already does the right thing; this adds the model field, locks the behaviour down with tests, and deals with the other half of QA's report.The new host receiving a visitor invitation
They were not being treated as a host at all — they were a newly added attendee, and the signal still named the old host, so
skip_host_emailhad nothing to match. The staff API change fixes that case, but it is the visible symptom of something broader: front ends mark every attendee of a meeting as an expected visitor, so colleagues are announced exactly like external guests and receive visitor invitations and QR codes.skip_internal_domain_email(defaultfalse) drops anyone sharing the host's email domain, on invitations, check-in and induction notifications, and change notifications. It is the no-configuration counterpart tohost_domain_filter, which needs an explicit domain list.Left off by default: staff visiting another site are legitimate visitors and share the host's domain, so turning this on for every deployment would silently stop those emails. Worth enabling per system — including the dev server, where it is what stops QA seeing the invitation to the new host.
Emails aimed at the host (
notify_checkin,notify_original_host) are unaffected — the filter tests the attendee's domain, not the recipient's.Testing
4 new specs:
host_domain_filterandskip_internal_domain_emailsuppressing a colleague's invitation and their change notification while an external visitor still gets both, the setting being off by default, and a reassignment signal notifying the previous host while naming the new host on the visitor's change email../harness report --basic-render --verbose --tests=1 drivers/place/visitor_mailer_spec.crpasses;crystal tool formatandamebaclean.Stacked on #620.