Skip to content

WPB-30563: meeting emails also reach registered conversation members - #5766

Open
blackheaven wants to merge 17 commits into
developfrom
gdifolco/WPB-30563-meetings-invite-members-emails
Open

blackheaven wants to merge 17 commits into
developfrom
gdifolco/WPB-30563-meetings-invite-members-emails

Conversation

@blackheaven

@blackheaven blackheaven commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-30563

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 1, 2026
@blackheaven
blackheaven force-pushed the gdifolco/WPB-30563-meetings-invite-members-emails branch from bb76083 to 346b7f9 Compare December 1, 2026 17:48
@blackheaven
blackheaven marked this pull request as ready for review December 1, 2026 21:37
@blackheaven
blackheaven requested review from a team as code owners December 1, 2026 21:37
- 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.
@blackheaven
blackheaven force-pushed the gdifolco/WPB-30563-meetings-invite-members-emails branch from a2fe4a8 to b918879 Compare December 2, 2026 01:04

@akshaymankar akshaymankar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a little fragile, is this documented somewhere for people who manage email templates?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines 72 to 73
NotifyMeetingMembersRemoved qUser qConvId mTeamId users ->
notifyMeetingMembersRemovedImpl qUser qConvId mTeamId users

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there no email sent here?

@blackheaven blackheaven Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invited may contain addresses as type by the user, right? they should be normalized before deduplication.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Your 2addbb0 covers the invite-list diffs; 8bf9b0d also deduplicates the final recipient list in prepareMeetingEmails by the brig email key, and add no longer stores a second spelling of an already-invited address.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@blackheaven blackheaven Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this hasn't been change in the german template

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants