Repository navigation
WPB-30563: meeting emails also reach registered conversation members - #5766
blackheaven wants to merge 17 commits into
Conversation
bb76083 to
346b7f9
Compare
- Every meeting email kind (invitation, update, join link changed, cancellation) is now also sent to registered conversation members with a verified email, in addition to the invited addresses. - Users added to a meeting conversation receive an invitation email, attributed to the member who added them (new optional `inviter_name` in the brig payload; template change in wire-emails 1.0.163). - Member-add invitations are gated on the owning team's meetings feature and are prepared and dispatched in a single detached child so they do not add to the MLS commit latency. - Email recipient computation and dispatch move to the new module Wire.MeetingsSubsystem.Email. - Galley: licenseInterpreter now sits outside interpretMeetingNotifier (member-add emails are license-gated).
- Drop the dedup helper in favour of List.nubOrd, use mapM_ on the Maybe-\case sites, a shared dispatchPayload for the RPC kind and payload, and a qualified import of Wire.MeetingsSubsystem.Email. - Stop threading emailsEnabled through the meeting notifier: the member-add push is the push-only version of develop, and the invitation email is a separate step whose team-feature gate and meeting lookup both run in the detached child.
…oval, join link in calendar entry
- Update email shows title and time changes as updated/previous values (new `previous_meeting` on the internal RPC, new `PreviousMeeting` payload type) and one change per line: the summary keeps its line breaks and is rendered through the new meeting-update-time/-name/-summary fragments inserted at `${update_blocks}`.
- Removing or replacing invited addresses sends the cancellation email to the addresses that were invited until then.
- The ICS of an invitation carries the join link in its DESCRIPTION too: Google Calendar ignores the URL property on import.
- Dates and times follow the email designs (`Monday, Oct. 12, 2026`, `9:00 – 10:00 AM`); the inviter placeholder is optional so the invitation can name the adder without disclosing a member's address.
- Vendors wire-emails v1.0.164: the invitation and update emails per the QA designs (visible button, updated/previous values through the meeting-update fragments), plus the template changes of v1.0.161 to v1.0.164 (team invitation, meeting cancellation). - The update text template takes the blocks without a trailing newline, so brig ends the text blocks on a line of their own; the new render test runs for English only, the other locales keep the previous update structure until translated.
- Update emails of a locale whose template has no change blocks yet (de, fr, it) are rendered with the default locale's template, so those recipients also get the updated/previous values instead of an empty "what changed" section. - The team-feature gate and the meeting lookup of the member-add invitation run under the same failure handling as its dispatch. - One change per line is asserted for the text and the HTML part; a time-zone-only update is asserted to send a summary without a previous meeting. - changelog.d entry for WPB-27192.
a2fe4a8 to
b918879
Compare
| loadMeetingTemplates :: FilePath -> Locale -> EmailAddress -> IO (Localised MeetingTemplates) | ||
| loadMeetingTemplates templatesDir defLocale sender = readLocalesDir defLocale templatesDir "meeting" $ \fp -> | ||
| loadMeetingTemplates templatesDir defLocale sender = readLocalesDir defLocale templatesDir "meeting" $ \fp -> do | ||
| hasBlocks <- DT.isInfixOf "${update_blocks}" <$> readText' fp "email/update.txt" |
There was a problem hiding this comment.
This seems to be a little fragile, is this documented somewhere for people who manage email templates?
There was a problem hiding this comment.
Sadly, there's no comments in Crowdin AFAIK, aren't tests enough?
| let newlyAdded = List.nubOrd emails \\ storedMeeting.invitedEmails | ||
| unless (null newlyAdded) $ | ||
| lift $ | ||
| Email.sendMeetingEmailsFor emailsEnabled (tDomain zUser) storedMeeting newlyAdded (Email.conversationMemberIds conv) mLocale DispatchInvitation |
There was a problem hiding this comment.
only newlyAdded should receive an email, right? but the conversation member Ids are also passed here, so AFAICT those existing members will also receive the email, no?
There was a problem hiding this comment.
Good catch, fixed: add/replace now only invites the newly added addresses. Members already get their invitation when they join.
| -- Added addresses get an invitation (and members are re-invited); | ||
| -- addresses dropped by the replacement get the cancellation email. | ||
| let added = List.nubOrd emails \\ storedMeeting.invitedEmails | ||
| removed = storedMeeting.invitedEmails \\ emails |
There was a problem hiding this comment.
AFAI understand, it is possible that a user is a member of the meeting and their email is in the invited emails list, when replacement happens and their email is not in the replacement list, the user satys a member of the meeting, but will receive a cancellation email, which is wrong, right?
There was a problem hiding this comment.
Right, thanks! Fixed: a dropped address gets no cancellation when it belongs to a user who is still a member of the meeting conversation (replace and remove).
| NotifyMeetingMembersRemoved qUser qConvId mTeamId users -> | ||
| notifyMeetingMembersRemovedImpl qUser qConvId mTeamId users |
There was a problem hiding this comment.
why is there no email sent here?
There was a problem hiding this comment.
Good point, added in 8bf9b0d: users removed from the meeting conversation now get a cancellation email.
| False -> pure Nothing | ||
| True -> do | ||
| memberAddrs <- memberEmailAddresses sm candidates | ||
| let recipients = List.nubOrd (invited <> memberAddrs) |
There was a problem hiding this comment.
invited may contain addresses as type by the user, right? they should be normalized before deduplication.
| let kind = "meeting invitation email" | ||
| tpl = meetingInvitationEmail . snd $ forLocale mLocale meetingTemplates | ||
| mail <- logEmailRenderErrors kind $ renderMeetingInvitationEmail email hostName hostEmail meeting tpl branding replyTo | ||
| mail <- logEmailRenderErrors kind $ renderMeetingInvitationEmail email hostName hostEmail meeting tpl branding replyTo inviterName |
There was a problem hiding this comment.
there seems to be a difference between the en and de meetings invitation template. one uses host_name and the other inviter_name, are they both correctly set? If not why isn't this caught by a unit test?
There was a problem hiding this comment.
Both were set, which is why nothing failed: the de/fr/it templates still used the old host_name wording. I have re-bumped wire-emails.
There was a problem hiding this comment.
so in the meantime we accept that the templates can produce different results? one sets host_name and the other inviter_name which might differ.
| ${meeting_title} | ||
| ${host_name} (${host_email}) has invited you to a meeting on Wire. | ||
| MEETING INVITATION | ||
| ${inviter_name} ${inviter_email_part}has invited you to join a meeting on |
There was a problem hiding this comment.
this hasn't been change in the german template
There was a problem hiding this comment.
The new sentence is now translated and approved in Crowdin for de/fr/it. It lands here with the next wire-emails bump, after wireapp/wire-emails#499 (host clause fragment) is merged and translated.
…recipients Compare recipients before and after each add, remove, or replace operation using Wire's normalized email key. Account for conversation membership so adding a member's typed address skips a duplicate invitation and removing it skips a cancellation while the member still participates. If the member-profile lookup fails, preserve the edit and skip its emails. Extend regression tests to cover overlapping membership and typed invites, including addresses that differ in casing.
…tive recipients - The invitation's host clause comes from the localised partials/meeting-host-clause fragment (wire-emails#499) instead of English text built in the server. - Users removed from a meeting conversation get a cancellation email, except the remover, the creator and addresses still invited. - Meeting email recipients are deduplicated by brig's email key (case-insensitive); adding an invited address already present in another case stores no second spelling.
- Vendors wire-emails v1.0.165: de/fr/it meeting invitation with the inviter
wording and ${host_clause}, de/fr/it update templates with the update
blocks, and the meeting-host-clause fragment (de partials included).
- The non-host-member invitation test now runs for every locale.
https://wearezeta.atlassian.net/browse/WPB-30563
Checklist
changelog.d