email

package
v0.0.0-...-fbd1cd9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliDMSender

type AliDMSender struct {
	// contains filtered or unexported fields
}

AliDMSender implements Sender

func NewAliDMSender

func NewAliDMSender(conf config.AliDMConf) *AliDMSender

NewAliDMSender 阿里云邮件推送

func (*AliDMSender) Send

func (s *AliDMSender) Send(email *Email) bool

type CmdSender

type CmdSender struct {
}

CmdSender implements Sender

func NewCmdSender

func NewCmdSender() *CmdSender

NewCmdSender sendmail

func (*CmdSender) Send

func (s *CmdSender) Send(email *Email) bool

type Email

type Email struct {
	FromAddr     string
	FromName     string
	ToAddr       string
	Subject      string
	Body         string
	LinkedNotify *entity.Notify
}

type EmailConf

type EmailConf struct {
	config.EmailConf
	Sender        Sender
	OnSendSuccess func(email *Email)
}

type EmailQueue

type EmailQueue struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(conf EmailConf) *EmailQueue

Initialize Email Queue

func (*EmailQueue) Close

func (q *EmailQueue) Close()

func (*EmailQueue) Push

func (q *EmailQueue) Push(email *Email)

Add an email to the sending queue

type Sender

type Sender interface {
	Send(email *Email) bool
}

Sender is an interface for sending email.

func NewSender

func NewSender(conf EmailConf) (Sender, error)

type SmtpSender

type SmtpSender struct {
	// contains filtered or unexported fields
}

SmtpSender implements Sender

func NewSmtpSender

func NewSmtpSender(smtp config.SMTPConf) *SmtpSender

NewSmtpSender SMTP

func (*SmtpSender) Send

func (s *SmtpSender) Send(email *Email) bool

Jump to

Keyboard shortcuts

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