| 123456789101112131415161718192021222324 |
- package config
- import "github.com/runningwater/gohub/pkg/config"
- func init() {
- config.Add("mail", func() map[string]any {
- return map[string]any{
- // 默认是 Mailhog 的配置
- "smtp": map[string]any{
- "host": config.Env("MAIL_HOST", "localhost"),
- "port": config.Env("MAIL_PORT", 1025),
- "username": config.Env("MAIL_USERNAME", ""),
- "password": config.Env("MAIL_PASSWORD", ""),
- },
- // 默认发件人
- "from": map[string]any{
- "address": config.Env("MAIL_FROM_ADDRESS", "gohub@example.com"),
- "name": config.Env("MAIL_FROM_NAME", "Gohub"),
- },
- }
- })
- }
|