Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
Name string `json:"name"`
Kind string `json:"kind"`
Content []byte `json:"content"`
}
Attachment is attachment for message send via smtp server
type ConfigurableRecorder ¶
type ConfigurableRecorder interface {
ConfigurableSender
Recorder
TxConfig() *TxConfig
}
type ConfigurableSender ¶
type MemRecorder ¶
type MemRecorder struct {
Mails []Mail
// contains filtered or unexported fields
}
func (*MemRecorder) Send ¶
func (r *MemRecorder) Send(from string, to To, message Message, options ...SendOption) (err error)
func (*MemRecorder) TxConfig ¶
func (r *MemRecorder) TxConfig() TxConfig
func (*MemRecorder) UpdateTxConfig ¶
func (r *MemRecorder) UpdateTxConfig(cfg TxConfig)
type Message ¶
type Message struct {
Topic string `json:"topic"`
Body string `json:"body"`
Attachments []Attachment `json:"attachments"`
ContentType string `json:"contentType"`
}
Message is message send via smtp server
type Option ¶
type Option func(*Template)
Option option to configure template
func AllowAttachments ¶
AllowAttachments allows attachements for letter
func TemplateFuncs ¶
TemplateFuncs merge template funcs with default template funcs for letter
func WithAttachments ¶
func WithAttachments(attachments RequestAttachments) Option
WithAttachments add attacments to a message
type RequestAttachment ¶
type RequestAttachment struct {
Name string `json:"name"`
// Content base64 encoded content
Content []byte `json:"content"`
}
RequestAttachment can be used in the request struct when attachments are allowed
type RequestAttachments ¶
type RequestAttachments []RequestAttachment
RequestAttachments list of RequestAttachments
type SendOption ¶
type SendOption interface {
// contains filtered or unexported methods
}
func AsCc ¶
func AsCc() SendOption
type Sender ¶
type Sender interface {
Send(from string, to To, message Message, options ...SendOption) (err error)
}
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template template for message
func NewTemplate ¶
NewTemplate creates new template
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) UpdateTxConfig ¶
UpdateTxConfig tx config. Is safe for concurrenct use.
type TxConfig ¶
type TxConfig struct {
User string `json:"user" ini:"user" yaml:"user"`
Password string `json:"password" ini:"password" yaml:"password"`
Host string `json:"host" ini:"host" yaml:"host"`
Port int `json:"port" ini:"port" yaml:"port"`
TmpDir string `json:"tmpDir" ini:"tmp-dir" envconfig:"TMP_DIR" yaml:"tmpDir"`
}
Click to show internal directories.
Click to hide internal directories.