diff options
author | 6543 <6543@obermui.de> | 2021-04-02 12:25:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-02 11:25:13 +0100 |
commit | 80d6c6d7deb3f6a38ff6d09ec38ffb04de9da726 (patch) | |
tree | 8651abe082da4e920753f03ee4c37de1668ab826 /modules/notification | |
parent | cc2d540092149166c9a0cef886b2e952ac9c75d7 (diff) | |
download | gitea-80d6c6d7deb3f6a38ff6d09ec38ffb04de9da726.tar.gz gitea-80d6c6d7deb3f6a38ff6d09ec38ffb04de9da726.zip |
[refactor] mailer service (#15072)
* Unexport SendUserMail
* Instead of "[]*models.User" or "[]string" lists infent "[]*MailRecipient" for mailer
* adopt
* code format
* TODOs for "i18n"
* clean
* no fallback for lang -> just use english
* lint
* exec testComposeIssueCommentMessage per lang and use only emails
* rm MailRecipient
* Dont reload from users from db if you alredy have in ram
* nits
* minimize diff
Signed-off-by: 6543 <6543@obermui.de>
* localize subjects
* linter ...
* Tr extend
* start tmpl edit ...
* Apply suggestions from code review
* use translation.Locale
* improve mailIssueCommentBatch
Signed-off-by: Andrew Thornton <art27@cantab.net>
* add i18n to datas
Signed-off-by: Andrew Thornton <art27@cantab.net>
* a comment
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/notification')
-rw-r--r-- | modules/notification/mail/mail.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go index f7192f5a52..9c000da0f6 100644 --- a/modules/notification/mail/mail.go +++ b/modules/notification/mail/mail.go @@ -104,14 +104,14 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *model // mail only sent to added assignees and not self-assignee if !removed && doer.ID != assignee.ID && assignee.EmailNotifications() == models.EmailNotificationsEnabled { ct := fmt.Sprintf("Assigned #%d.", issue.Index) - mailer.SendIssueAssignedMail(issue, doer, ct, comment, []string{assignee.Email}) + mailer.SendIssueAssignedMail(issue, doer, ct, comment, []*models.User{assignee}) } } func (m *mailNotifier) NotifyPullReviewRequest(doer *models.User, issue *models.Issue, reviewer *models.User, isRequest bool, comment *models.Comment) { if isRequest && doer.ID != reviewer.ID && reviewer.EmailNotifications() == models.EmailNotificationsEnabled { ct := fmt.Sprintf("Requested to review %s.", issue.HTMLURL()) - mailer.SendIssueAssignedMail(issue, doer, ct, comment, []string{reviewer.Email}) + mailer.SendIssueAssignedMail(issue, doer, ct, comment, []*models.User{reviewer}) } } @@ -153,7 +153,7 @@ func (m *mailNotifier) NotifyPullRequestPushCommits(doer *models.User, pr *model } func (m *mailNotifier) NotifyPullRevieweDismiss(doer *models.User, review *models.Review, comment *models.Comment) { - if err := mailer.MailParticipantsComment(comment, models.ActionPullReviewDismissed, review.Issue, []*models.User{}); err != nil { + if err := mailer.MailParticipantsComment(comment, models.ActionPullReviewDismissed, review.Issue, nil); err != nil { log.Error("MailParticipantsComment: %v", err) } } |