user_notify.go 370 B

1234567891011121314151617
  1. package service
  2. import (
  3. "fmt"
  4. "one-api/common"
  5. "one-api/model"
  6. )
  7. func notifyRootUser(subject string, content string) {
  8. if common.RootUserEmail == "" {
  9. common.RootUserEmail = model.GetRootUserEmail()
  10. }
  11. err := common.SendEmail(subject, common.RootUserEmail, content)
  12. if err != nil {
  13. common.SysError(fmt.Sprintf("failed to send email: %s", err.Error()))
  14. }
  15. }