mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-11 16:05:49 +01:00
Use '{loginName} {fromAddress}' for the from field within the notification emails
This commit is contained in:
12
doc/README.email-sender.md
Normal file
12
doc/README.email-sender.md
Normal file
@@ -0,0 +1,12 @@
|
||||
Email Sender
|
||||
============
|
||||
|
||||
As of gitbucket 3.4, the sender of the notification emails is build like this:
|
||||
|
||||
* {fromName} {fromAddress} ... in case you configured both of them
|
||||
* {loginName} notifications@gitbucket.com ... in case you configured none of them
|
||||
* {fromAddress} ... in case you configured only the from address
|
||||
|
||||
For me, I'd like to see this:
|
||||
|
||||
* {loginName} {fromAddress} ... when from name isn't configured
|
||||
@@ -87,7 +87,7 @@ class Mailer(private val smtp: Smtp) extends Notifier {
|
||||
email.setSSLOnConnect(ssl)
|
||||
}
|
||||
smtp.fromAddress
|
||||
.map (_ -> smtp.fromName.orNull)
|
||||
.map (_ -> smtp.fromName.getOrElse(context.loginAccount.get.userName))
|
||||
.orElse (Some("notifications@gitbucket.com" -> context.loginAccount.get.userName))
|
||||
.foreach { case (address, name) =>
|
||||
email.setFrom(address, name)
|
||||
|
||||
Reference in New Issue
Block a user