mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Move all mail related codes from models to services/mailer (#7200)
* move all mail related codes from models to modules/mailer * fix lint * use DBContext instead Engine * use WithContext not WithEngine * Use DBContext instead of Engine * don't use defer when sess.Close() * move DBContext to context.go and add some methods * move mailer from modules/ to services * fix lint * fix tests * fix fmt * add gitea copyright * fix tests * don't expose db functions * make code clear * add DefaultDBContext * fix build * fix bug
This commit is contained in:
		| @@ -22,6 +22,7 @@ import ( | ||||
| 	"code.gitea.io/gitea/modules/process" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| 	"code.gitea.io/gitea/modules/timeutil" | ||||
| 	"code.gitea.io/gitea/services/mailer" | ||||
|  | ||||
| 	"gitea.com/macaron/macaron" | ||||
| 	"github.com/unknwon/com" | ||||
| @@ -197,7 +198,7 @@ func Dashboard(ctx *context.Context) { | ||||
| func SendTestMail(ctx *context.Context) { | ||||
| 	email := ctx.Query("email") | ||||
| 	// Send a test email to the user's email address and redirect back to Config | ||||
| 	if err := models.SendTestMail(email); err != nil { | ||||
| 	if err := mailer.SendTestMail(email); err != nil { | ||||
| 		ctx.Flash.Error(ctx.Tr("admin.config.test_mail_failed", email, err)) | ||||
| 	} else { | ||||
| 		ctx.Flash.Info(ctx.Tr("admin.config.test_mail_sent", email)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user