You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
752 B

3 years ago
  1. package email
  2. import (
  3. "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/global"
  4. "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/router"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type emailPlugin struct{}
  8. func CreateEmailPlug(To, From, Host, Secret, Nickname string, Port int, IsSSL bool) *emailPlugin {
  9. global.GlobalConfig.To = To
  10. global.GlobalConfig.From = From
  11. global.GlobalConfig.Host = Host
  12. global.GlobalConfig.Secret = Secret
  13. global.GlobalConfig.Nickname = Nickname
  14. global.GlobalConfig.Port = Port
  15. global.GlobalConfig.IsSSL = IsSSL
  16. return &emailPlugin{}
  17. }
  18. func (*emailPlugin) Register(group *gin.RouterGroup) {
  19. router.RouterGroupApp.InitEmailRouter(group)
  20. }
  21. func (*emailPlugin) RouterPath() string {
  22. return "email"
  23. }