mail

package
v0.0.0-...-cd4d371 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSenderNotFound = errors.New("sender not found")

ErrSenderNotFound 发送方式未找到

View Source
var ParseAddress = interfaces.ParseAddress

Functions

This section is empty.

Types

type Address

type Address = interfaces.Address

type Attachment

type Attachment = interfaces.Attachment

type Message

type Message = interfaces.Message

type Sender

type Sender = interfaces.Sender

type Service

type Service struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Service 邮件发送服务

func New

func New(ctx context.Context, config *config.Service) (s *Service, err error)

New 新建邮件发送服务

func (*Service) Register

func (s *Service) Register(name string, provider Sender)

Register 注册发送方式

name 发送方式标识
provider 发送方法

func (*Service) Send

func (s *Service) Send(ctx context.Context, senderName string, message *Message) (bizId, name string, err error)

Send 发送邮件

senderName 发送方式
message 发送的消息结构体 -> Message

@return

biznId 返回发送方(如果有)提供一个业务ID,用于追踪发送过程

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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