mail

package
v2.17.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Sender        string `yaml:"sender"`
	EmailUsername string `yaml:"username"`
	EmailPassword string `yaml:"password"`
	SecretKey     string `yaml:"secret_key"`
	EmailFrom     string `yaml:"from"`
	FromName      string `yaml:"from_name"`
	Host          string `yaml:"host"`
	Port          int    `yaml:"port"`
}

type Mandrill

type Mandrill struct {
	*Config
	// contains filtered or unexported fields
}

func (*Mandrill) AddAttachment

func (m *Mandrill) AddAttachment(attachment *mandrill.Attachment) Mandrills

func (*Mandrill) AddRecipient

func (m *Mandrill) AddRecipient(recipientEmail, recipientName string) Mandrills

func (*Mandrill) Send

func (m *Mandrill) Send() error

func (*Mandrill) SetEmailFrom

func (m *Mandrill) SetEmailFrom(emailFrom string) Mandrills

func (*Mandrill) SetFromName

func (m *Mandrill) SetFromName(fromName string) Mandrills

func (*Mandrill) SetGlobalMergeVars

func (m *Mandrill) SetGlobalMergeVars(data map[string]interface{}) Mandrills

func (*Mandrill) SetHTMLContent

func (m *Mandrill) SetHTMLContent(subject, htmlContent string) Mandrills

func (*Mandrill) SetTemplate

func (m *Mandrill) SetTemplate(templateName string, templateContent map[string]string) Mandrills

func (*Mandrill) SetTextContent

func (m *Mandrill) SetTextContent(subject, textContent string) Mandrills

type Mandrills

type Mandrills interface {
	AddRecipient(recipientEmail, recipientName string) Mandrills
	AddAttachment(attachment *mandrill.Attachment) Mandrills
	SetHTMLContent(subject, htmlContent string) Mandrills
	SetTextContent(subject, textContent string) Mandrills
	SetGlobalMergeVars(data map[string]interface{}) Mandrills
	SetTemplate(templateName string, templateContent map[string]string) Mandrills
	SetEmailFrom(emailFrom string) Mandrills
	SetFromName(fromName string) Mandrills
	Send() error
}

func NewMandrill

func NewMandrill(opts *Config) Mandrills

type SMTP

type SMTP struct {
	SMTPConfig
	// contains filtered or unexported fields
}

func NewSMTP

func NewSMTP(opts ...SMTPOptions) *SMTP

func (*SMTP) AddRecipient

func (s *SMTP) AddRecipient(recipient ...string) *SMTP

func (*SMTP) Send

func (s *SMTP) Send() error

func (*SMTP) SetContent

func (s *SMTP) SetContent(subject, message string) *SMTP

func (*SMTP) SetHTMLTemplate

func (s *SMTP) SetHTMLTemplate(fs embed.FS, tplFile, subject string, args interface{}) *SMTP

func (*SMTP) SetSingleRecipient

func (s *SMTP) SetSingleRecipient(recipient string) *SMTP

type SMTPConfig

type SMTPConfig struct {
	Config
	// contains filtered or unexported fields
}

type SMTPOptions added in v2.5.0

type SMTPOptions func(*SMTPConfig)

func WithEmail added in v2.5.0

func WithEmail(email string) SMTPOptions

func WithEmailFrom added in v2.5.0

func WithEmailFrom(emailFrom string) SMTPOptions

func WithEmailPassword added in v2.5.0

func WithEmailPassword(password string) SMTPOptions

func WithHost added in v2.5.0

func WithHost(host string) SMTPOptions

func WithPort added in v2.5.0

func WithPort(port int) SMTPOptions

func WithSender added in v2.5.0

func WithSender(sender string) SMTPOptions

type SMTPs

type SMTPs interface {
	AddRecipient(recipient ...string) *SMTP
	SetContent(subject, message string) *SMTP
	SetHTMLTemplate(fs embed.FS, tplFile, subject string, args interface{}) *SMTP
	SetSingleRecipient(recipient string) *SMTP
	Send() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL