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.

37 lines
869 B

  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. To string
  9. From string
  10. Host string
  11. Secret string
  12. Nickname string
  13. Port int
  14. IsSsl bool
  15. }
  16. func CreateEmailPlug(To, From, Host, Secret, Nickname string, Port int, IsSSL bool) *emailPlugin {
  17. global.GlobalConfig.To = To
  18. global.GlobalConfig.From = From
  19. global.GlobalConfig.Host = Host
  20. global.GlobalConfig.Secret = Secret
  21. global.GlobalConfig.Nickname = Nickname
  22. global.GlobalConfig.Port = Port
  23. global.GlobalConfig.IsSSL = IsSSL
  24. return &emailPlugin{}
  25. }
  26. func (*emailPlugin) Register(group *gin.RouterGroup) {
  27. router.RouterGroupApp.InitEmailRouter(group)
  28. }
  29. func (*emailPlugin) RouterPath() string {
  30. return "email"
  31. }