Use '{loginName} {fromAddress}' for the from field within the notification emails

This commit is contained in:
Uli Heller
2015-06-27 08:45:27 +02:00
parent c4a682773c
commit ad55d5199d
2 changed files with 13 additions and 1 deletions

View 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

View File

@@ -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)