mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-09 02:46:29 +02:00
Update Mailer.send() signature
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user