diff --git a/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala b/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala index a70e8ba..d06ef88 100644 --- a/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala @@ -24,7 +24,7 @@ "activityLogLimit" -> trim(label("Limit of activity logs", optional(number()))), "ssh" -> trim(label("SSH access", boolean())), "sshPort" -> trim(label("SSH port", optional(number()))), - "useSMTP" -> trim(label("SMTP", boolean())), + "useSMTP" -> trim(label("SMTP", boolean())), "smtp" -> optionalIfNotChecked("useSMTP", mapping( "host" -> trim(label("SMTP Host", text(required))), "port" -> trim(label("SMTP Port", optional(number()))), diff --git a/src/main/scala/gitbucket/core/servlet/AutoUpdate.scala b/src/main/scala/gitbucket/core/servlet/AutoUpdate.scala index c81a9a9..4169e77 100644 --- a/src/main/scala/gitbucket/core/servlet/AutoUpdate.scala +++ b/src/main/scala/gitbucket/core/servlet/AutoUpdate.scala @@ -21,6 +21,15 @@ * The history of versions. A head of this sequence is the current BitBucket version. */ val versions = Seq( + new Version(3, 7) with SystemSettingsService { + override def update(conn: Connection, cl: ClassLoader): Unit = { + super.update(conn, cl) + val settings = loadSystemSettings() + if(settings.notification){ + saveSystemSettings(settings.copy(useSMTP = true)) + } + } + }, new Version(3, 6), new Version(3, 5), new Version(3, 4), diff --git a/src/main/twirl/gitbucket/core/admin/system.scala.html b/src/main/twirl/gitbucket/core/admin/system.scala.html index 251d72a..7a08c67 100644 --- a/src/main/twirl/gitbucket/core/admin/system.scala.html +++ b/src/main/twirl/gitbucket/core/admin/system.scala.html @@ -239,7 +239,7 @@
@@ -288,6 +288,9 @@
+

+ Enable notification not only SMTP configuration if you want to send nitification email. +