Email: add reply-to and direct attachment (#18715)

* Add support for `Reply-To` header

* Allow direct attachment

Don't have tests yet, but they will follow
This commit is contained in:
Oleg Gaidarenko
2019-08-26 16:44:18 +02:00
committed by GitHub
parent e5e7bd3153
commit c5bca40566
3 changed files with 79 additions and 21 deletions
+17 -7
View File
@@ -5,15 +5,25 @@ import "errors"
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
var ErrSmtpNotEnabled = errors.New("SMTP not configured, check your grafana.ini config file's [smtp] section")
type SendEmailCommand struct {
To []string
Template string
Subject string
Data map[string]interface{}
Info string
EmbededFiles []string
// SendEmailAttachFile is a definition of the attached files without path
type SendEmailAttachFile struct {
Name string
Content []byte
}
// SendEmailCommand is command for sending emails
type SendEmailCommand struct {
To []string
Template string
Subject string
Data map[string]interface{}
Info string
ReplyTo []string
EmbededFiles []string
AttachedFiles []*SendEmailAttachFile
}
// SendEmailCommandSync is command for sending emails in sync
type SendEmailCommandSync struct {
SendEmailCommand
}