Documentation
¶
Index ¶
Constants ¶
const ( HtmlFormat = "HTML" PlainFormat = "PLAIN" )
Html/Text message format
const ( ActSend = iota ActSendAll ActDontSend ActAbortSend ActContinueError )
Action to be taken before sending. Options send email(Y/N/Abort)?
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Server *ServerConfig `json:"server"`
Delivery *DeliveryConfig `json:"delivery"`
Tls *TlsConfig `json:"tls"`
Verbose bool `json:"verbose"`
}
Config stores configuration for the application
func LoadConfig ¶
LoadConfig loads configuration from file, either in JSON or HJSON
type DeliveryConfig ¶
type DeliveryConfig struct {
From string `json:"from"`
CcList string `json:"ccList"`
BccList string `json:"bccList"`
MailFormat string `json:"mailFormat"`
TemplateFiles []string `json:"templateFiles"`
TemplateName string `json:"templateName"`
DataFile string `json:"dataFile"`
ToDataField string `json:"toDataField"`
SubjectDataField string `json:"subjectDataField"`
DefaultSubject string `json:"defaultSubject"`
SkipConfirmBeforeSend bool `json:"skipConfirmBeforeSend"`
TestAddress string `json:"testAddress"`
SendMode bool `json:"sendMode"`
SentFile string `json:"sentFile"`
SkipIfSent bool `json:"skipIfSent"`
RequiredFields []string `json:"requiredFields"`
IntervalBetweenSend string `json:"intervalBetweenSend"`
}
DeliveryConfig stores delivery configuration
type Executer ¶
Executer for different template
func ParseHtmlTemplates ¶
ParseHtmlTemplates parse templates in text format
func ParseTextTemplates ¶
ParseTextTemplates parse templates in text format
type MailData ¶
type MailData map[string]interface{}
MailData to-be applied to template
func (MailData) StringDefault ¶
StringDefault return string value or default
type MailDataCollection ¶
type MailDataCollection struct {
Data []MailData
}
MailDataCollection stores list of mail data from spreadsheet
func NewMailDataCollection ¶
func NewMailDataCollection(conf *Config) (*MailDataCollection, error)
NewMailDataCollection create mail data collection from files
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
Mailer data structure
type ServerConfig ¶
type ServerConfig struct {
Authentication string `json:"authentication"`
Encryption string `json:"encryption"`
Username string `json:"username"`
Password string `json:"password"`
Helo string `json:"helo"`
ConnectTimeout string `json:"connectTimeout"`
SendTimeout string `json:"sendTimeout"`
Host string `json:"host"`
Port int `json:"port"`
KeepAlive bool `json:"keepAlive"`
}
ServerConfig stores connection configuration
func (*ServerConfig) Configure ¶
func (s *ServerConfig) Configure(srv *mail.SMTPServer) error
Configure server