Update Mailer.send() signature

This commit is contained in:
Naoki Takezoe
2017-09-16 03:11:40 +09:00
parent 106f7a41d8
commit 801d71b6d2
2 changed files with 6 additions and 8 deletions

View File

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

View File

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