notifications.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package models
  2. import "errors"
  3. var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
  4. var ErrSmtpNotEnabled = errors.New("SMTP not configured, check your grafana.ini config file's [smtp] section")
  5. // SendEmailAttachFile is a definition of the attached files without path
  6. type SendEmailAttachFile struct {
  7. Name string
  8. Content []byte
  9. }
  10. // SendEmailCommand is command for sending emails
  11. type SendEmailCommand struct {
  12. To []string
  13. Template string
  14. Subject string
  15. Data map[string]interface{}
  16. Info string
  17. ReplyTo []string
  18. EmbededFiles []string
  19. AttachedFiles []*SendEmailAttachFile
  20. }
  21. // SendEmailCommandSync is command for sending emails in sync
  22. type SendEmailCommandSync struct {
  23. SendEmailCommand
  24. }
  25. type SendWebhookSync struct {
  26. Url string
  27. User string
  28. Password string
  29. Body string
  30. HttpMethod string
  31. HttpHeader map[string]string
  32. ContentType string
  33. }
  34. type SendResetPasswordEmailCommand struct {
  35. User *User
  36. }
  37. type ValidateResetPasswordCodeQuery struct {
  38. Code string
  39. Result *User
  40. }