mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
25 lines
524 B
Go
25 lines
524 B
Go
package models
|
|
|
|
type SendEmailCommand struct {
|
|
To []string
|
|
From string
|
|
Subject string
|
|
Body string
|
|
Type string
|
|
Massive bool
|
|
Info string
|
|
}
|
|
|
|
// create mail content
|
|
func (m *SendEmailCommand) Content() string {
|
|
// set mail type
|
|
contentType := "text/plain; charset=UTF-8"
|
|
if m.Type == "html" {
|
|
contentType = "text/html; charset=UTF-8"
|
|
}
|
|
|
|
// create mail content
|
|
content := "From: " + m.From + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
|
|
return content
|
|
}
|