Documentation ¶
Index ¶
- Variables
- type Attachment
- type Config
- type Delivery
- func (d *Delivery) CheckInvalidContent(c notification.Content) ([]string, error)
- func (d *Delivery) ContentFields() []*notificationdelivery.Field
- func (d *Delivery) Deliver(c notification.Content) (notificationdelivery.DeliveryStatus, string, error)
- func (d *Delivery) DeliveryType() string
- func (d *Delivery) MustEscape(unescaped string) string
- type SMTP
Constants ¶
This section is empty.
Variables ¶
View Source
var ContentNameAttachments = "attachments"
View Source
var ContentNameBCC = "bcc"
View Source
var ContentNameCC = "cc"
View Source
var ContentNameFrom = "from"
View Source
var ContentNameHTML = "html"
View Source
var ContentNameReplyTo = "replyto"
View Source
var ContentNameSender = "sender"
View Source
var ContentNameSubject = "subject"
View Source
var ContentNameText = "text"
View Source
var ContentNameTo = "to"
View Source
var DeliveryType = "email"
View Source
var Factory = func(loader func(interface{}) error) (notificationdelivery.DeliveryDriver, error) { c := &Config{} err := loader(c) if err != nil { return nil, err } d := &Delivery{ SMTP: c.SMTP, } return d, nil }
View Source
var Fields = []*notificationdelivery.Field{ { Name: ContentNameFrom, Example: "NAME <mail@example.com>", Escape: "", }, { Name: ContentNameSubject, Example: "EMAIL SUBJECT", Escape: "", }, { Name: ContentNameTo, Example: `TONAME <to@example.com>,mail@example.com`, Escape: "commaescape", }, { Name: ContentNameText, Example: "THIS IS A TEXT EMAIL\nLINE 2.", Escape: "", }, { Name: ContentNameHTML, Example: "<p>\nTHIS IS A <b>HTML</b> EMAIL\n</p>", Escape: "", }, { Name: ContentNameAttachments, Example: "[{\"Filename\":\"1.png\",\"DataURI\":\"https://URL\",\"ContentType\":\"image/png\"},{\"Filename\":\"2.png\",\"DataURI\":\"https://URL2\"}]", Escape: "jsonescape", }, { Name: ContentNameReplyTo, Example: `REPLYTONAME <replyto@example.com>`, Escape: "", }, { Name: ContentNameCC, Example: `CCNAME <cc@example.com>,mail@example.com`, Escape: "commaescape", }, { Name: ContentNameBCC, Example: `BCCNAME <bcc@example.com>,mail@example.com`, Escape: "commaescape", }, { Name: ContentNameSender, Example: "", Escape: "", }, }
View Source
var RequeiredContent = []string{ContentNameTo}
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Delivery ¶
type Delivery struct {
SMTP SMTP
}
func (*Delivery) CheckInvalidContent ¶
func (d *Delivery) CheckInvalidContent(c notification.Content) ([]string, error)
CheckInvalidContent check if given content invalid Return invalid fields and any error raised
func (*Delivery) ContentFields ¶
func (d *Delivery) ContentFields() []*notificationdelivery.Field
ContentFields return content fields Return invalid fields and any error raised
func (*Delivery) Deliver ¶
func (d *Delivery) Deliver(c notification.Content) (notificationdelivery.DeliveryStatus, string, error)
func (*Delivery) DeliveryType ¶
func (*Delivery) MustEscape ¶
type SMTP ¶
type SMTP struct { Sender string // Host smtp host addr Host string Port int // Identity user identity(user account) for stmp arddr Identity string //default email to address To string // email from address From string // Username email stmp user name Username string // Pasword email smtp password Password string StartTLS bool SSL bool InsecureSkipVerify bool }
Click to show internal directories.
Click to hide internal directories.