Skip to content
Snippets Groups Projects
Unverified Commit ae4c236a authored by Eric Eastwood's avatar Eric Eastwood Committed by GitHub
Browse files

Fix room `type` typo in mailer (#17336)

Correct event content field is `EventContentFields.ROOM_TYPE` (`type`) :white_check_mark: , not `room_type` :x:

Spec: https://spec.matrix.org/v1.10/client-server-api/#mroomcreate
parent 930a64b6
Branches
Tags
No related merge requests found
Fix email notification subject when invited to a space.
...@@ -28,7 +28,7 @@ import jinja2 ...@@ -28,7 +28,7 @@ import jinja2
from markupsafe import Markup from markupsafe import Markup
from prometheus_client import Counter from prometheus_client import Counter
from synapse.api.constants import EventTypes, Membership, RoomTypes from synapse.api.constants import EventContentFields, EventTypes, Membership, RoomTypes
from synapse.api.errors import StoreError from synapse.api.errors import StoreError
from synapse.config.emailconfig import EmailSubjectConfig from synapse.config.emailconfig import EmailSubjectConfig
from synapse.events import EventBase from synapse.events import EventBase
...@@ -716,7 +716,8 @@ class Mailer: ...@@ -716,7 +716,8 @@ class Mailer:
) )
if ( if (
create_event create_event
and create_event.content.get("room_type") == RoomTypes.SPACE and create_event.content.get(EventContentFields.ROOM_TYPE)
== RoomTypes.SPACE
): ):
return self.email_subjects.invite_from_person_to_space % { return self.email_subjects.invite_from_person_to_space % {
"person": inviter_name, "person": inviter_name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment