Documentation
¶
Index ¶
- Constants
- func GetFooter() string
- func SendMail(s *NotificationSetting, to, cc, title, content string) error
- func SendMobileNotification(webhook string, title string, content string) error
- type MailTheme
- type MailThemeFlat
- type NotificationSetting
- type NotificationSettingMail
- type NotificationSettingMobile
- type NotificationSettingTarget
- type NotificationSettingTrigger
- type ResBody
- type SendPayload
- type Service
Constants ¶
View Source
const ( ExtraValueTypeNotification = "notification" ExtraValueModelGlobal = "global" )
View Source
const ( NotificationTypeMail = "mail" NotificationTypeMobile = "mobile" )
View Source
const (
NotificationSettingsColName = "notification_settings"
)
Variables ¶
This section is empty.
Functions ¶
func SendMail ¶
func SendMail(s *NotificationSetting, to, cc, title, content string) error
Types ¶
type MailThemeFlat ¶
type MailThemeFlat struct{}
MailThemeFlat is a theme
func (*MailThemeFlat) GetStyle ¶
func (dt *MailThemeFlat) GetStyle() string
func (*MailThemeFlat) HTMLTemplate ¶
func (dt *MailThemeFlat) HTMLTemplate() string
HTMLTemplate returns a Golang template that will generate an HTML email.
func (*MailThemeFlat) Name ¶
func (dt *MailThemeFlat) Name() string
Name returns the name of the flat theme
func (*MailThemeFlat) PlainTextTemplate ¶
func (dt *MailThemeFlat) PlainTextTemplate() string
PlainTextTemplate returns a Golang template that will generate an plain text email.
type NotificationSetting ¶
type NotificationSetting struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Type string `json:"type" bson:"type"`
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"description"`
Enabled bool `json:"enabled" bson:"enabled"`
Global bool `json:"global" bson:"global"`
Title string `json:"title,omitempty" bson:"title,omitempty"`
Template string `json:"template,omitempty" bson:"template,omitempty"`
Triggers []string `json:"triggers" bson:"triggers"`
Targets []NotificationSettingTarget `json:"targets" bson:"targets"` // TODO: implement
Mail NotificationSettingMail `json:"mail,omitempty" bson:"mail,omitempty"`
Mobile NotificationSettingMobile `json:"mobile,omitempty" bson:"mobile,omitempty"`
}
type NotificationSettingMail ¶
type NotificationSettingMail struct {
Server string `json:"server" bson:"server"`
Port string `json:"port,omitempty" bson:"port,omitempty"`
User string `json:"user,omitempty" bson:"user,omitempty"`
Password string `json:"password,omitempty" bson:"password,omitempty"`
SenderEmail string `json:"sender_email,omitempty" bson:"sender_email,omitempty"`
SenderIdentity string `json:"sender_identity,omitempty" bson:"sender_identity,omitempty"`
To string `json:"to,omitempty" bson:"to,omitempty"`
Cc string `json:"cc,omitempty" bson:"cc,omitempty"`
}
type NotificationSettingMobile ¶
type NotificationSettingMobile struct {
Webhook string `json:"webhook" bson:"webhook"`
}
type SendPayload ¶
type Service ¶
func NewService ¶
func NewService() *Service
Click to show internal directories.
Click to hide internal directories.