A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix(email): support to specify the email sending from name
LinkinStar3090745b1102
diff --git a/internal/service/export/email_service.go b/internal/service/export/email_service.goindex 6f24b5e4..42058543 100644--- a/internal/service/export/email_service.go+++ b/internal/service/export/email_service.go@@ -5,6 +5,7 @@ import ("encoding/json""fmt""html/template"+ "mime""github.com/answerdev/answer/internal/base/reason""github.com/answerdev/answer/internal/entity"@@ -93,7 +94,8 @@ func (es *EmailService) Send(ctx context.Context, toEmailAddr, subject, body, co}m := gomail.NewMessage()- m.SetHeader("From", ec.FromEmail)+ fromName := mime.QEncoding.Encode("utf-8", ec.FromName)+ m.SetHeader("From", fmt.Sprintf("%s <%s>", fromName, ec.FromEmail))m.SetHeader("To", toEmailAddr)m.SetHeader("Subject", subject)m.SetBody("text/html", body)