mail.go 677 B

123456789101112131415161718192021222324
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package mailer
  5. import (
  6. "github.com/gogits/gogs/models"
  7. "github.com/gogits/gogs/modules/base"
  8. )
  9. func GetMailTmplData(user *models.User) map[interface{}]interface{} {
  10. data := make(map[interface{}]interface{}, 10)
  11. data["AppName"] = base.AppName
  12. data["AppVer"] = base.AppVer
  13. data["AppUrl"] = base.AppUrl
  14. data["AppLogo"] = base.AppLogo
  15. data["ActiveCodeLives"] = base.Service.ActiveCodeLives
  16. data["ResetPwdCodeLives"] = base.Service.ResetPwdCodeLives
  17. if user != nil {
  18. data["User"] = user
  19. }
  20. return data
  21. }