2015-06-05 14:15:38 +08:00
|
|
|
package models
|
|
|
|
|
2015-06-08 19:39:02 +08:00
|
|
|
import "errors"
|
|
|
|
|
|
|
|
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
|
2019-04-23 16:24:47 +08:00
|
|
|
var ErrSmtpNotEnabled = errors.New("SMTP not configured, check your grafana.ini config file's [smtp] section")
|
2015-06-08 19:39:02 +08:00
|
|
|
|
2015-06-05 14:15:38 +08:00
|
|
|
type SendEmailCommand struct {
|
2016-10-20 21:06:59 +08:00
|
|
|
To []string
|
|
|
|
Template string
|
2016-12-15 21:26:35 +08:00
|
|
|
Subject string
|
2016-10-20 21:06:59 +08:00
|
|
|
Data map[string]interface{}
|
|
|
|
Info string
|
|
|
|
EmbededFiles []string
|
2015-06-05 14:15:38 +08:00
|
|
|
}
|
|
|
|
|
2016-10-03 15:38:03 +08:00
|
|
|
type SendEmailCommandSync struct {
|
|
|
|
SendEmailCommand
|
|
|
|
}
|
|
|
|
|
|
|
|
type SendWebhookSync struct {
|
2017-03-24 04:53:54 +08:00
|
|
|
Url string
|
|
|
|
User string
|
|
|
|
Password string
|
|
|
|
Body string
|
|
|
|
HttpMethod string
|
|
|
|
HttpHeader map[string]string
|
|
|
|
ContentType string
|
2016-10-03 15:38:03 +08:00
|
|
|
}
|
|
|
|
|
2015-06-05 14:15:38 +08:00
|
|
|
type SendResetPasswordEmailCommand struct {
|
2015-06-05 17:08:19 +08:00
|
|
|
User *User
|
2015-06-05 14:15:38 +08:00
|
|
|
}
|
|
|
|
|
2015-06-08 19:39:02 +08:00
|
|
|
type ValidateResetPasswordCodeQuery struct {
|
|
|
|
Code string
|
|
|
|
Result *User
|
|
|
|
}
|