mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 12:52:23 +08:00
32 lines
668 B
Go
32 lines
668 B
Go
package models
|
|
|
|
type SendEmailCommand struct {
|
|
To []string
|
|
From string
|
|
Subject string
|
|
Body string
|
|
Massive bool
|
|
Info string
|
|
}
|
|
|
|
type SendResetPasswordEmailCommand struct {
|
|
User *User
|
|
}
|
|
|
|
// create mail content
|
|
func (m *SendEmailCommand) Content() string {
|
|
contentType := "text/html; charset=UTF-8"
|
|
content := "From: " + m.From + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
|
|
return content
|
|
}
|
|
|
|
// Create html mail command
|
|
func NewSendEmailCommand(To []string, From, Subject, Body string) SendEmailCommand {
|
|
return SendEmailCommand{
|
|
To: To,
|
|
From: From,
|
|
Subject: Subject,
|
|
Body: Body,
|
|
}
|
|
}
|