Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Email ¶
type Email struct {
core.QueueItem
Credentials *EmailCredentials
Data *EmailData
}
func (*Email) MarshalBinary ¶
func (*Email) UnmarshalBinary ¶
type EmailAttachment ¶
type EmailAttachment struct {
Filename string `json:"filename"`
Data []byte `json:"data"`
Inline bool `json:"inline"`
}
EmailAttachment represents an email attachment.
type EmailCredentials ¶
type EmailCredentials struct {
Address string `json:"address"`
Hostname string `json:"hostname"`
Name string `json:"name"`
Port string `json:"port"`
Password string `json:"password"`
}
EmailCredentials stores the relevant credenial data to send emails.
func (*EmailCredentials) LoadFromConfig ¶
func (ec *EmailCredentials) LoadFromConfig(dir string) error
LoadFromConfig loads the email credentials from a JSON config file.
type EmailData ¶
type EmailData struct {
From mail.Address `json:"from"`
To []string `json:"to"`
Cc []string `json:"cc"`
Bcc []string `json:"bcc"`
ReplyTo string `json:"replyto"`
Subject string `json:"subject"`
Body string `json:"body"`
BodyContentType string `json:"bodycontenttype"`
Headers []Header `json:"headers"`
Attachments map[string]*EmailAttachment `json:"attachments"`
}
EmailData represents a smtp message.
func NewHTMLMessage ¶
NewHTMLMessage returns a new EmailData that can compose an HTML email with attachments
func NewPlainTextMessage ¶
NewPlainTextMessage returns a new EmailData that can compose an email with attachments
func (*EmailData) AddAttachment ¶
AddAttachment adds a new attachment to the message.
func (*EmailData) AttachBuffer ¶
AttachBuffer attaches a binary attachment.
func (*EmailData) GetRecipients ¶
GetRecipients returns all the recipients of the message.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles emails and other simlar functionality within the package.
func (*Service) DequeueEmail ¶
func (*Service) EnqueueEmail ¶
Click to show internal directories.
Click to hide internal directories.