Documentation
¶
Index ¶
- func Default(cfg Config, templateEngine *render.HtmlEngine)
- func Html(view string, body utils.H) string
- func Queue(msg Mail, queue *mail.Queue) error
- func Send(msg Mail) error
- func SendMail(msg Mail) error
- type Application
- type Attachment
- type Body
- type Config
- type Mail
- type Mailer
- type SendMailJob
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Default ¶
func Default(cfg Config, templateEngine *render.HtmlEngine)
Types ¶
type Application ¶
type Application struct {
Mailer *Mailer
}
func (*Application) Init ¶
func (app *Application) Init() *Mailer
type Attachment ¶
type Config ¶
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"`
AwsAccessKey string `json:"aws_access_key"`
AwsSecretKey string `json:"aws_secret_key"`
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"`
Charset string `json:"charset"`
Region string `json:"region"`
}
func GetMailConfig ¶
func GetMailConfig() Config
type Mail ¶
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 ¶
type Mailer struct {
*sMail.SMTPServer
*sMail.SMTPClient
*render.HtmlEngine
Config Config
}
var DefaultMailer *Mailer
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()
Click to show internal directories.
Click to hide internal directories.