Documentation ¶
Index ¶
- type Attachment
- type BatchSender
- type Body
- type Message
- func (m *Message) AddAttachment(name, contentType string, r io.Reader) error
- func (m *Message) AddBodies(data render.Data, renderers ...render.Renderer) error
- func (m *Message) AddBody(r render.Renderer, data render.Data) error
- func (m *Message) AddEmbedded(name string, r io.Reader) error
- func (m *Message) SetHeader(field, value string)
- type SMTPSender
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment are files added into a email message
type BatchSender ¶
type BatchSender interface { Sender SendBatch(messages ...Message) (errorsByMessages []error, generalError error) }
BatchSender interface for sending batch or single mail
type Message ¶
type Message struct { Context context.Context From string To []string CC []string Bcc []string Subject string Headers map[string]string Data render.Data Bodies []Body Attachments []Attachment // contains filtered or unexported fields }
Message represents an Email message
func NewFromData ¶
NewFromData builds a new message with raw template data given
func (*Message) AddAttachment ¶
AddAttachment adds the attachment to the list of attachments the Message has.
func (*Message) AddBodies ¶
AddBodies Allows to add multiple bodies to the message, it returns errors that could happen in the rendering.
func (*Message) AddBody ¶
AddBody the message by receiving a renderer and rendering data, first message will be used as the main message Body rest of them will be passed as alternative bodies on the email message
func (*Message) AddEmbedded ¶
AddEmbedded adds the attachment to the list of attachments the Message has and uses inline instead of attachement property.
type SMTPSender ¶
SMTPSender allows to send Emails by connecting to a SMTP server.
func NewSMTPSender ¶
NewSMTPSender builds a SMTP mail based in passed config.
func (SMTPSender) Send ¶
func (sm SMTPSender) Send(message Message) error
Send a message using SMTP configuration or returns an error if something goes wrong.