Documentation
¶
Overview ¶
Package mail provides a mail service
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplatesFS embed.FS
Functions ¶
func MailWorker ¶ added in v0.0.8
Worker processes emails from the mail queue nolint:revive // Keeping original name for backward compatibility
func ProcessMail ¶ added in v0.0.8
ProcessMail handles the actual sending of an email
Types ¶
type EmbeddedImage ¶ added in v0.0.11
type EmbeddedImage struct {
ContentID string // ContentID to be referenced in HTML, e.g., <img src="cid:image1">
Path string // Path to the image file
Data []byte // Raw image data (optional, used if Path is empty)
}
EmbeddedImage represents an image to be embedded in an email
type Mail ¶ added in v0.0.8
type Mail struct {
FromName string
FromEmail string
To string
Subject string
Body string // Plain text body (used only if Template is empty)
HTMLBody string // HTML body (used only if Template is empty)
Template string // Template name to use
TemplateData interface{} // Data to pass to the template
Attachments []string // Paths to files to attach
Images []EmbeddedImage // Images to embed in the email
MetaData interface{} // Additional metadata
}
Mail is a struct that holds the data for a mail
func (*Mail) AttachFile ¶ added in v0.0.11
AttachFile adds a file to the email attachments
type TemplateEngine ¶ added in v0.0.11
type TemplateEngine struct {
// contains filtered or unexported fields
}
TemplateEngine handles email template rendering
var ( MailQueue chan Mail GlobalTemplateEngine *TemplateEngine )
func GetTemplateEngine ¶ added in v0.0.11
func GetTemplateEngine() *TemplateEngine
GetTemplateEngine returns the global template engine instance
func (*TemplateEngine) Init ¶ added in v0.0.11
func (te *TemplateEngine) Init() error
Init initializes the template engine by loading all templates
Click to show internal directories.
Click to hide internal directories.