mail

package
v1.0.57 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default added in v1.0.57

func Default(cfg Config, templateEngine *render.HtmlEngine)

func Html added in v1.0.57

func Html(view string, body utils.H) string

func Send added in v1.0.57

func Send(msg Mail) error

func SendMail

func SendMail(msg Mail) error

Types

type Application

type Application struct {
	Mailer *Mailer
}

func (*Application) Init

func (app *Application) Init() *Mailer

type Attachment added in v1.0.57

type Attachment struct {
	Data     []byte
	File     string
	FileName string
	MimeType string
}

type Body added in v1.0.57

type Body struct {
	Content string
	// contains filtered or unexported fields
}

func View added in v1.0.57

func View(view string, body utils.H) *Body

func (*Body) Send added in v1.0.57

func (t *Body) Send(msg Mail) error

type Config added in v1.0.57

type Config struct {
	Host        string `json:"host" yaml:"host" env:"MAIL_HOST"`
	Username    string `json:"username" yaml:"username" env:"MAIL_USERNAME"`
	Password    string `json:"password" yaml:"password" env:"MAIL_PASSWORD"`
	Encryption  string `json:"encryption" yaml:"encryption" env:"MAIL_ENCRYPTION"`
	FromAddress string `json:"from_address" yaml:"from_address" env:"MAIL_FROM_ADDRESS"`
	FromName    string `json:"from_name" yaml:"from_name" env:"MAIL_FROM_NAME"`
	EmailLayout string `json:"layout" yaml:"layout" env:"MAIL_LAYOUT"`
	Port        int    `json:"port" yaml:"port" env:"MAIL_PORT"`
}

func GetMailConfig added in v1.0.57

func GetMailConfig() Config

type Mail added in v1.0.57

type Mail struct {
	To          []string     `json:"to,omitempty"`
	From        string       `json:"from,omitempty"`
	Subject     string       `json:"subject,omitempty"`
	Body        string       `json:"body,omitempty"`
	Bcc         []string     `json:"bcc,omitempty"`
	Cc          []string     `json:"cc,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
	AttachFiles []Attachment `json:"attach_files"`
	// contains filtered or unexported fields
}

type Mailer added in v1.0.57

type Mailer struct {
	*sMail.SMTPServer
	*sMail.SMTPClient
	*render.HtmlEngine
	Config Config
}
var DefaultMailer *Mailer

func New added in v1.0.57

func New(cfg Config, templateEngine *render.HtmlEngine) *Mailer

func (*Mailer) Html added in v1.0.57

func (m *Mailer) Html(view string, body utils.H) string

func (*Mailer) Queue added in v1.0.57

func (m *Mailer) Queue(msg Mail, queue *mail.Queue) error

func (*Mailer) Send added in v1.0.57

func (m *Mailer) Send(msg Mail) error

func (*Mailer) View added in v1.0.57

func (m *Mailer) View(view string, body utils.H) *Body

type SendMailJob

type SendMailJob struct {
}

func (*SendMailJob) Handle

func (r *SendMailJob) Handle(args ...any) error

Handle Execute the job.

func (*SendMailJob) Signature

func (r *SendMailJob) Signature() string

Signature The name and signature of the job.

type ServiceProvider

type ServiceProvider struct {
	Mailer *Mailer
}

func (*ServiceProvider) Boot

func (route *ServiceProvider) Boot()

func (*ServiceProvider) Register

func (route *ServiceProvider) Register()

Jump to

Keyboard shortcuts

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