2015-06-04 10:23:46 -05:00
|
|
|
package notifications
|
|
|
|
|
|
|
|
import (
|
|
|
|
m "github.com/grafana/grafana/pkg/models"
|
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
|
|
)
|
|
|
|
|
2015-06-08 09:51:25 -05:00
|
|
|
type Message struct {
|
2016-10-20 08:06:59 -05:00
|
|
|
To []string
|
|
|
|
From string
|
|
|
|
Subject string
|
|
|
|
Body string
|
|
|
|
Info string
|
|
|
|
EmbededFiles []string
|
2015-06-04 10:23:46 -05:00
|
|
|
}
|
|
|
|
|
2015-06-08 09:51:25 -05:00
|
|
|
func setDefaultTemplateData(data map[string]interface{}, u *m.User) {
|
2015-06-04 10:23:46 -05:00
|
|
|
data["AppUrl"] = setting.AppUrl
|
|
|
|
data["BuildVersion"] = setting.BuildVersion
|
|
|
|
data["BuildStamp"] = setting.BuildStamp
|
2015-06-08 03:57:01 -05:00
|
|
|
data["EmailCodeValidHours"] = setting.EmailCodeValidMinutes / 60
|
2015-06-05 04:08:19 -05:00
|
|
|
data["Subject"] = map[string]interface{}{}
|
2015-06-04 10:23:46 -05:00
|
|
|
if u != nil {
|
2015-06-08 03:57:01 -05:00
|
|
|
data["Name"] = u.NameOrFallback()
|
2015-06-04 10:23:46 -05:00
|
|
|
}
|
|
|
|
}
|