-
Notifications
You must be signed in to change notification settings - Fork 132
fix(notifications): resolve email not sent for team invites #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: enext
Are you sure you want to change the base?
Changes from 5 commits
a0de4b8
d6c4ec0
98749dc
7079351
73a989c
e9fad2e
de6d22f
a6c6da4
0aa36bc
94fc21f
47ca471
e923e0c
0e6a13b
91fb93d
f81c321
1ba6fd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,14 @@ | ||
| {% load i18n %}{% blocktrans with url=url|safe %}Hello, | ||
hemantmm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| you have been invited to the following event team | ||
| You have been invited to join the team "{{ team }}" for the organizer "{{ organizer }}". | ||
|
|
||
| Organizer: {{ organizer }} | ||
| Team: {{ team }} | ||
|
|
||
| If you want to join that team, just click on the following link: | ||
| Please click the following link to accept the invitation: | ||
| {{ url }} | ||
|
|
||
| If you are already logged in, you will be automatically added to the team. Otherwise, please log in or create an account to join. | ||
|
|
||
| If you do not want to join, you can safely ignore or delete this email. | ||
|
|
||
| Best regards, | ||
|
|
||
| Your event team | ||
| {% endblocktrans %} | ||
| {% endblocktrans %} | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,9 @@ | |||||
| ) | ||||||
| from django_scopes import scopes_disabled | ||||||
|
|
||||||
| import logging | ||||||
| logger = logging.getLogger(__name__) | ||||||
|
|
||||||
| from eventyay.base.auth import get_auth_backends | ||||||
hemantmm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| from eventyay.base.models.auth import User | ||||||
| from eventyay.base.models.organizer import Team, TeamAPIToken, TeamInvite | ||||||
|
|
@@ -173,7 +176,10 @@ def _send_invite(self, instance): | |||||
| try: | ||||||
| mail( | ||||||
| instance.email, | ||||||
| _('eventyay account invitation'), | ||||||
| _('You have been invited to join the team "{team}" for "{organizer}"').format( | ||||||
| team=instance.team.name, | ||||||
| organizer=self.request.organizer.name, | ||||||
| ), | ||||||
| 'pretixcontrol/email/invitation.txt', | ||||||
| { | ||||||
| 'user': self, | ||||||
hemantmm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
@@ -304,16 +310,37 @@ def post(self, request, *args, **kwargs): | |||||
| ) | ||||||
| return self.get(request, *args, **kwargs) | ||||||
|
|
||||||
| # Send email to registered user and then add them | ||||||
| try: | ||||||
| mail( | ||||||
| user.email, | ||||||
| _('You have been invited to join the team "{team}" for "{organizer}"').format( | ||||||
| team=self.object.name, | ||||||
| organizer=self.request.organizer.name, | ||||||
| ), | ||||||
| 'pretixcontrol/email/invitation.txt', | ||||||
| { | ||||||
| 'user': user, | ||||||
| 'organizer': self.request.organizer.name, | ||||||
| 'team': self.object.name, | ||||||
| 'url': build_global_uri('eventyay_common:organizer.team', kwargs={'organizer': self.request.organizer.slug, 'team': self.object.pk}), | ||||||
| }, | ||||||
| event=None, | ||||||
| locale=self.request.LANGUAGE_CODE, | ||||||
| ) | ||||||
| except SendMailException: | ||||||
| logger.warning("Failed to send invitation to existing member %s", user.email, exc_info=True) | ||||||
| messages.warning(self.request, _('The new member was added to the team, but the invitation email could not be sent.')) | ||||||
|
||||||
| messages.warning(self.request, _('The new member was added to the team, but the invitation email could not be sent.')) | |
| messages.warning(self.request, _('The new member will be added to the team, but the invitation email could not be sent.')) |
hemantmm marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace on this blank line. Remove the trailing whitespace to maintain code cleanliness.
Uh oh!
There was an error while loading. Please reload this page.