Skip to content
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

♻️ Add username in email #314

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Oct 9, 2024

Purpose

For the moment we are using the sender's email in the email, but we have sometimes the full name of the sender.

Proposal

Use the fullname instead of the email if it is available.

@AntoLC AntoLC self-assigned this Oct 9, 2024
@AntoLC AntoLC linked an issue Oct 9, 2024 that may be closed by this pull request
@@ -31,7 +31,7 @@
<!-- Main Message -->
<mj-text>
{% blocktrans %}
{{username}} invited you as an {{role}} on the following document :
{{username}} {{email}} invited you as an {{role}} on the following document :
Copy link
Collaborator

@virgile-dev virgile-dev Oct 9, 2024

Choose a reason for hiding this comment

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

{{username}} ({{email}}) invited you with the role "{{role}}" on the following document :

Copy link
Contributor

Choose a reason for hiding this comment

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

why do we want to add the email here?

access.document.email_invitation(
language, access.user.email, access.role, self.request.user.email
language, access.user.email, access.role, username_sender, email_sender
Copy link
Contributor

Choose a reason for hiding this comment

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

Semantically, shouldn't it be:

Suggested change
language, access.user.email, access.role, username_sender, email_sender
language, access.user.email, access.role, sender_name, sender_email

The term "username" is usually used with another meaning.

@@ -520,7 +520,7 @@ def get_abilities(self, user):
"versions_retrieve": can_get_versions,
}

def email_invitation(self, language, email, role, username_sender):
def email_invitation(self, language, email, role, username_sender, email_sender):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def email_invitation(self, language, email, role, username_sender, email_sender):
def email_invitation(self, language, email, role, username_sender, sender_email):

@@ -31,7 +31,7 @@
<!-- Main Message -->
<mj-text>
{% blocktrans %}
{{username}} invited you as an {{role}} on the following document :
{{username}} {{email}} invited you as an {{role}} on the following document :
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we want to add the email here?

Comment on lines +789 to +790
username_sender = self.request.user.full_name
email_sender = self.request.user.email
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
username_sender = self.request.user.full_name
email_sender = self.request.user.email
sender_name = self.request.user.full_name
sender_email = self.request.user.email

Comment on lines +580 to +581
username_sender = self.request.user.full_name
email_sender = self.request.user.email
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
username_sender = self.request.user.full_name
email_sender = self.request.user.email
sender_name = self.request.user.full_name
sender_email = self.request.user.email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

♻️Replace email by name in email
3 participants