diff options
author | zeripath <art27@cantab.net> | 2019-04-17 05:56:40 +0100 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-17 00:56:40 -0400 |
commit | 827ab6b75a70a3cd90033a4d49bb44c635dd3310 (patch) | |
tree | 4eeb03f67d96288dddedbca0215759c622e5b5b1 /modules/mailer | |
parent | 84fd24246cd5565b9654bf752b9919df03e69271 (diff) | |
download | gitea-827ab6b75a70a3cd90033a4d49bb44c635dd3310.tar.gz gitea-827ab6b75a70a3cd90033a4d49bb44c635dd3310.zip |
Add SUBJECT_PREFIX mailer config option (#6605)
* Add SUBJECT_PREFIX mailer config option
* Add space between subject prefix and subject (Change from Gogs)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 84da0d4c17..411d6eafd8 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -38,7 +38,11 @@ func NewMessageFrom(to []string, fromDisplayName, fromAddress, subject, body str msg := gomail.NewMessage() msg.SetAddressHeader("From", fromAddress, fromDisplayName) msg.SetHeader("To", to...) - msg.SetHeader("Subject", subject) + if len(setting.MailService.SubjectPrefix) > 0 { + msg.SetHeader("Subject", setting.MailService.SubjectPrefix+" "+subject) + } else { + msg.SetHeader("Subject", subject) + } msg.SetDateHeader("Date", time.Now()) msg.SetHeader("X-Auto-Response-Suppress", "All") |