feat: allow configuring smtp sender display name

This commit is contained in:
Fu Diwei
2025-06-11 23:07:17 +08:00
parent c6dfe11bdb
commit 563adbec2a
9 changed files with 77 additions and 47 deletions

View File

@@ -26,6 +26,8 @@ type NotifierConfig struct {
Password string `json:"password"`
// 发件人邮箱。
SenderAddress string `json:"senderAddress"`
// 发件人显示名称。
SenderName string `json:"senderName,omitempty"`
// 收件人邮箱。
ReceiverAddress string `json:"receiverAddress"`
}
@@ -86,6 +88,7 @@ func (n *NotifierProvider) Notify(ctx context.Context, subject string, message s
}
yak.From(n.config.SenderAddress)
yak.FromName(n.config.SenderName)
yak.To(n.config.ReceiverAddress)
yak.Subject(subject)
yak.Plain().Set(message)