mailservice

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRetries    = 3               // 最大重试次数
	RetryInterval = time.Second * 5 // 重试间隔
	BatchSize     = 10              // 每次处理的任务数量
)

Variables

This section is empty.

Functions

func AddToQueue

func AddToQueue(task EmailTask) error

AddToQueue 添加邮件任务到队列

func SendActivationEmail

func SendActivationEmail(to, username, token string) error

func StartEmailProcessor

func StartEmailProcessor()

StartEmailProcessor 启动邮件处理器

Types

type EmailConfig

type EmailConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	FromName string
}

type EmailTask

type EmailTask struct {
	To       string `json:"to"`
	Username string `json:"username"`
	Token    string `json:"token"`
	Type     string `json:"type"` // activation, reset_password 等
}

Jump to

Keyboard shortcuts

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