mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Began work on emailing service #1456
This commit is contained in:
24
pkg/models/emails.go
Normal file
24
pkg/models/emails.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user