diff --git a/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala b/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala index 080d499d0..46b403c74 100644 --- a/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala @@ -175,9 +175,11 @@ trait SystemSettingsControllerBase extends AccountManagementControllerBase { post("/admin/system/sendmail", sendMailForm)(adminOnly { form => try { new Mailer(form.smtp).send(form.testAddress, - "Test message from GitBucket", context.loginAccount.get, - "This is a test message from GitBucket.", None - ) + "Test message from GitBucket", + "This is a test message from GitBucket.", + None, + context.loginAccount + ) "Test mail has been sent to: " + form.testAddress diff --git a/src/main/scala/gitbucket/core/util/Notifier.scala b/src/main/scala/gitbucket/core/util/Notifier.scala index c0bd83213..d3ee0342c 100644 --- a/src/main/scala/gitbucket/core/util/Notifier.scala +++ b/src/main/scala/gitbucket/core/util/Notifier.scala @@ -47,7 +47,7 @@ class Mailer(private val smtp: Smtp) extends Notifier { val f = Future { database withSession { session => recipients(loginAccount)(session) foreach { to => - send(to, subject, loginAccount, textMsg, htmlMsg) + send(to, subject, textMsg, htmlMsg, Some(loginAccount)) } } "Notifications Successful." @@ -59,10 +59,6 @@ class Mailer(private val smtp: Smtp) extends Notifier { } } - def send(to: String, subject: String, loginAccount: Account, textMsg: String, htmlMsg: Option[String] = None): Unit = { - send(to, subject, textMsg, htmlMsg, Some(loginAccount)) - } - def send(to: String, subject: String, textMsg: String, htmlMsg: Option[String] = None, loginAccount: Option[Account] = None): Unit = { val email = new HtmlEmail email.setHostName(smtp.host)