Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultEmailBody = `` /* 204-byte string literal not displayed */
View Source
const DefaultEmailSubject = `Smart Core Notifications Monthly Report {{.Now.Format "Jan 02, 2006"}}`
Variables ¶
View Source
var (
DefaultSendTime = jsontypes.MustParseSchedule("0 0 * * 1")
)
Functions ¶
This section is empty.
Types ¶
type AttachmentCfg ¶
func (*AttachmentCfg) AttachFile ¶
func (d *AttachmentCfg) AttachFile(name string, b []byte)
type Destination ¶
type Destination struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
Username string `json:"username,omitempty"` // defaults to From.Address
jsontypes.Password
From string `json:"from,omitempty"` // RFC 5322 address, the address part used for auth against Host
To []string `json:"to,omitempty"` // RFC 5322 address
SendTime *jsontypes.Schedule `json:"sendTime,omitempty"` // defaults to midnight on Monday mornings: "0 0 * * 1"
SubjectTemplate jsontypes.String `json:"subjectTemplate,omitempty"`
BodyTemplate jsontypes.String `json:"bodyTemplate,omitempty"`
Parsed *ParsedDestination `json:"-"`
}
func (Destination) Addr ¶
func (d Destination) Addr() string
Addr returns the combination of Host and Port, taking defaults into account. Suitable for smtp.Dial.
func (Destination) Parse ¶
func (d Destination) Parse() (*ParsedDestination, error)
func (Destination) ReadBodyTemplate ¶
func (d Destination) ReadBodyTemplate() (*template.Template, error)
func (Destination) ReadSubjectTemplate ¶
func (d Destination) ReadSubjectTemplate() (*template.Template, error)
type ParsedDestination ¶
type Root ¶
type Root struct {
auto.Config
// Configuration information for how to send the email.
Destination Destination `json:"destination,omitempty"`
AlertHubName string `json:"source,omitempty"`
Now func() time.Time `json:"-"`
Timeout time.Duration `json:"timeout,omitempty"`
Subject string `json:"subject,omitempty"`
TemplateArgs TemplateArgs `json:"templateArgs,omitempty"`
}
type TemplateArgs ¶
type TemplateArgs struct {
EmailTitle string `json:"emailTitle,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.