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

Use FullName in Emails to address the recipient if possible #31527

Merged
merged 14 commits into from
Jul 8, 2024

Conversation

6543
Copy link
Member

@6543 6543 commented Jun 29, 2024

Before we had just the plain mail address as recipient. But now we provide additional Information for the Mail clients.


Sponsored by Kithara Software GmbH

@6543 6543 added the type/enhancement An improvement of existing functionality label Jun 29, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 29, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 29, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jun 29, 2024
services/mailer/mail.go Outdated Show resolved Hide resolved
models/user/user_test.go Outdated Show resolved Hide resolved
models/user/user.go Outdated Show resolved Hide resolved
models/user/user.go Outdated Show resolved Hide resolved
@6543 6543 requested a review from delvh June 30, 2024 10:01
models/user/user.go Outdated Show resolved Hide resolved
models/user/user.go Outdated Show resolved Hide resolved
@6543 6543 requested a review from silverwind July 4, 2024 14:51
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 4, 2024
6543 added a commit to 6543-forks/gitea that referenced this pull request Jul 5, 2024
@6543 6543 requested a review from techknowlogick July 5, 2024 20:12
return u.Email
}

return fmt.Sprintf("%s <%s>", mime.QEncoding.Encode("utf-8", add.Name), add.Address)
Copy link
Member

Choose a reason for hiding this comment

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

Why not encode the sanitizedDisplayName beforehand?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because then the mime encoding is undone

@@ -413,6 +415,34 @@ func (u *User) DisplayName() string {
return u.Name
}

var emailToReplacer = strings.NewReplacer(
Copy link
Member

Choose a reason for hiding this comment

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

emailNameReplacer?
I don't see any reason why we should only use it for To.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right now we do, if it gets reused some can just rename it

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 7, 2024
@6543 6543 enabled auto-merge (squash) July 8, 2024 04:01
@6543 6543 added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 8, 2024
@6543 6543 merged commit 4696bcb into go-gitea:main Jul 8, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Jul 8, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 8, 2024
@6543 6543 deleted the emails-use-fullname branch July 8, 2024 08:38
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 9, 2024
* giteaofficial/main:
  Use FullName in Emails to address the recipient if possible (go-gitea#31527)
  Don't show hidden labels when filling out an issue template (go-gitea#31576)
  [skip ci] Updated translations via Crowdin
  Convert frontend code to typescript (go-gitea#31559)
  [skip ci] Updated translations via Crowdin
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants