@@ -61,7 +61,7 @@ func SendTestMail(email string) error {
6161 // No mail service configured
6262 return nil
6363 }
64- return gomail .Send (Sender , NewMessage ([] string { email } , "Gitea Test Email!" , "Gitea Test Email!" ).ToMessage ())
64+ return gomail .Send (Sender , NewMessage (email , "Gitea Test Email!" , "Gitea Test Email!" ).ToMessage ())
6565}
6666
6767// sendUserMail sends a mail to the user
@@ -86,7 +86,7 @@ func sendUserMail(language string, u *user_model.User, tpl base.TplName, code, s
8686 return
8787 }
8888
89- msg := NewMessage ([] string { u .Email } , subject , content .String ())
89+ msg := NewMessage (u .Email , subject , content .String ())
9090 msg .Info = fmt .Sprintf ("UID: %d, %s" , u .ID , info )
9191
9292 SendAsync (msg )
@@ -137,7 +137,7 @@ func SendActivateEmailMail(u *user_model.User, email *user_model.EmailAddress) {
137137 return
138138 }
139139
140- msg := NewMessage ([] string { email .Email } , locale .Tr ("mail.activate_email" ), content .String ())
140+ msg := NewMessage (email .Email , locale .Tr ("mail.activate_email" ), content .String ())
141141 msg .Info = fmt .Sprintf ("UID: %d, activate email" , u .ID )
142142
143143 SendAsync (msg )
@@ -168,7 +168,7 @@ func SendRegisterNotifyMail(u *user_model.User) {
168168 return
169169 }
170170
171- msg := NewMessage ([] string { u .Email } , locale .Tr ("mail.register_notify" ), content .String ())
171+ msg := NewMessage (u .Email , locale .Tr ("mail.register_notify" ), content .String ())
172172 msg .Info = fmt .Sprintf ("UID: %d, registration notify" , u .ID )
173173
174174 SendAsync (msg )
@@ -202,7 +202,7 @@ func SendCollaboratorMail(u, doer *user_model.User, repo *repo_model.Repository)
202202 return
203203 }
204204
205- msg := NewMessage ([] string { u .Email } , subject , content .String ())
205+ msg := NewMessage (u .Email , subject , content .String ())
206206 msg .Info = fmt .Sprintf ("UID: %d, add collaborator" , u .ID )
207207
208208 SendAsync (msg )
@@ -322,7 +322,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient
322322
323323 msgs := make ([]* Message , 0 , len (recipients ))
324324 for _ , recipient := range recipients {
325- msg := NewMessageFrom ([] string { recipient .Email } , ctx .Doer .DisplayName (), setting .MailService .FromEmail , subject , mailBody .String ())
325+ msg := NewMessageFrom (recipient .Email , ctx .Doer .DisplayName (), setting .MailService .FromEmail , subject , mailBody .String ())
326326 msg .Info = fmt .Sprintf ("Subject: %s, %s" , subject , info )
327327
328328 msg .SetHeader ("Message-ID" , msgID )
0 commit comments