@@ -29,9 +29,8 @@ import (
29
29
"code.gitea.io/gitea/modules/timeutil"
30
30
"code.gitea.io/gitea/modules/translation"
31
31
incoming_payload "code.gitea.io/gitea/services/mailer/incoming/payload"
32
+ sender_service "code.gitea.io/gitea/services/mailer/sender"
32
33
"code.gitea.io/gitea/services/mailer/token"
33
-
34
- "gopkg.in/gomail.v2"
35
34
)
36
35
37
36
const (
@@ -60,7 +59,7 @@ func SendTestMail(email string) error {
60
59
// No mail service configured
61
60
return nil
62
61
}
63
- return gomail .Send (Sender , NewMessage (email , "Gitea Test Email!" , "Gitea Test Email!" ). ToMessage ( ))
62
+ return sender_service .Send (sender , sender_service . NewMessage (email , "Gitea Test Email!" , "Gitea Test Email!" ))
64
63
}
65
64
66
65
// sendUserMail sends a mail to the user
@@ -82,7 +81,7 @@ func sendUserMail(language string, u *user_model.User, tpl base.TplName, code, s
82
81
return
83
82
}
84
83
85
- msg := NewMessage (u .EmailTo (), subject , content .String ())
84
+ msg := sender_service . NewMessage (u .EmailTo (), subject , content .String ())
86
85
msg .Info = fmt .Sprintf ("UID: %d, %s" , u .ID , info )
87
86
88
87
SendAsync (msg )
@@ -130,7 +129,7 @@ func SendActivateEmailMail(u *user_model.User, email string) {
130
129
return
131
130
}
132
131
133
- msg := NewMessage (email , locale .TrString ("mail.activate_email" ), content .String ())
132
+ msg := sender_service . NewMessage (email , locale .TrString ("mail.activate_email" ), content .String ())
134
133
msg .Info = fmt .Sprintf ("UID: %d, activate email" , u .ID )
135
134
136
135
SendAsync (msg )
@@ -158,7 +157,7 @@ func SendRegisterNotifyMail(u *user_model.User) {
158
157
return
159
158
}
160
159
161
- msg := NewMessage (u .EmailTo (), locale .TrString ("mail.register_notify" , setting .AppName ), content .String ())
160
+ msg := sender_service . NewMessage (u .EmailTo (), locale .TrString ("mail.register_notify" , setting .AppName ), content .String ())
162
161
msg .Info = fmt .Sprintf ("UID: %d, registration notify" , u .ID )
163
162
164
163
SendAsync (msg )
@@ -189,13 +188,13 @@ func SendCollaboratorMail(u, doer *user_model.User, repo *repo_model.Repository)
189
188
return
190
189
}
191
190
192
- msg := NewMessage (u .EmailTo (), subject , content .String ())
191
+ msg := sender_service . NewMessage (u .EmailTo (), subject , content .String ())
193
192
msg .Info = fmt .Sprintf ("UID: %d, add collaborator" , u .ID )
194
193
195
194
SendAsync (msg )
196
195
}
197
196
198
- func composeIssueCommentMessages (ctx * mailCommentContext , lang string , recipients []* user_model.User , fromMention bool , info string ) ([]* Message , error ) {
197
+ func composeIssueCommentMessages (ctx * mailCommentContext , lang string , recipients []* user_model.User , fromMention bool , info string ) ([]* sender_service. Message , error ) {
199
198
var (
200
199
subject string
201
200
link string
@@ -304,9 +303,9 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient
304
303
return nil , err
305
304
}
306
305
307
- msgs := make ([]* Message , 0 , len (recipients ))
306
+ msgs := make ([]* sender_service. Message , 0 , len (recipients ))
308
307
for _ , recipient := range recipients {
309
- msg := NewMessageFrom (
308
+ msg := sender_service . NewMessageFrom (
310
309
recipient .Email ,
311
310
fromDisplayName (ctx .Doer ),
312
311
setting .MailService .FromEmail ,
0 commit comments