mail

package
v1.9.15 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 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 added in v1.1.8

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 added in v0.2.11

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

func (*Mandrill) AddAttachment added in v0.2.12

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

func (*Mandrill) AddRecipient added in v0.2.11

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

func (*Mandrill) Send added in v0.2.11

func (m *Mandrill) Send() error

func (*Mandrill) SetEmailFrom added in v0.5.20

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

func (*Mandrill) SetFromName added in v0.5.20

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

func (*Mandrill) SetGlobalMergeVars added in v0.2.13

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

func (*Mandrill) SetHTMLContent added in v0.2.11

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

func (*Mandrill) SetTemplate added in v0.2.13

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

func (*Mandrill) SetTextContent added in v0.2.11

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

type Mandrills added in v0.2.11

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 added in v0.2.11

func NewMandrill(opts *Config) Mandrills

type SMTP

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

func NewSMTP

func NewSMTP(cfg *SMTPConfig) *SMTP

func (*SMTP) AddRecipient added in v0.2.10

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

func (*SMTP) Send

func (s *SMTP) Send(recipient ...string) error

func (*SMTP) SetContent

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

func (*SMTP) SetHTMLTemplate added in v1.1.10

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

func (*SMTP) SetSingleRecipient added in v1.6.4

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

type SMTPConfig

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

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(recipient ...string) error
}

Jump to

Keyboard shortcuts

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