Documentation ¶
Overview ¶
Copyright (c) 2021 Kross IAM Project. https://github.com/krossdev/iam-ms/blob/main/LICENSE
Index ¶
- Constants
- func ExecTemplate(name string, locale string, data interface{}) (string, error)
- func Setup(conf *config.Mail)
- func TemplateImagePath(name string) string
- func TemplateLogoPath() string
- type Attachment
- type Header
- type Message
- func (m *Message) AddBCC(address *mail.Address) []*mail.Address
- func (m *Message) AddCC(address *mail.Address) []*mail.Address
- func (m *Message) AddHeader(key string, value string) Header
- func (m *Message) AddTO(address *mail.Address) []*mail.Address
- func (m *Message) Attach(file string) error
- func (m *Message) AttachBuffer(filename string, buf []byte, inline bool) error
- func (m *Message) Inline(file string, cid string) error
- func (m *Message) Send() error
- type TemplateData
Constants ¶
View Source
const ( TVerifyEmail = "verify-email" TAccountAddEmail = "account-add-email" )
template name constants
Variables ¶
This section is empty.
Functions ¶
func ExecTemplate ¶
load template from file, support i18n
func TemplateImagePath ¶
return full image path in template directory
Types ¶
type Attachment ¶
type Attachment struct { Filename string // filename Data []byte // attachment data Inline bool // is inline ContentId string // content id }
Attachment represents an email attachment.
type Message ¶
type Message struct { To []*mail.Address Cc []*mail.Address Bcc []*mail.Address ReplyTo string Subject string Body string BodyType string Headers []Header Attachments map[string]*Attachment // contains filtered or unexported fields }
Message represents a smtp message.
func HTMLMessage ¶
HTMLMessage returns a new Message that can compose an HTML email with attachments
func TextMessage ¶
TextMessage returns a new Message that can compose an email with attachments
func (*Message) AttachBuffer ¶
AttachBuffer attaches a binary attachment.
type TemplateData ¶
Click to show internal directories.
Click to hide internal directories.