X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fapplication_requirements.ex;h=16f62b6f5d43e00caa18e612479f66e82bffcaae;hb=c12c576ee28016444b89c426d67c960f156e831e;hp=f0f34734e88c8664aaf37dc9eb80844914f02ec1;hpb=62fc8eab0dfd3f4c60c8f36fd3a544d6785ff2c6;p=akkoma diff --git a/lib/pleroma/application_requirements.ex b/lib/pleroma/application_requirements.ex index f0f34734e..16f62b6f5 100644 --- a/lib/pleroma/application_requirements.ex +++ b/lib/pleroma/application_requirements.ex @@ -18,6 +18,7 @@ defmodule Pleroma.ApplicationRequirements do :ok |> check_confirmation_accounts! |> check_migrations_applied!() + |> check_welcome_message_config!() |> check_rum!() |> handle_result() end @@ -25,16 +26,33 @@ defmodule Pleroma.ApplicationRequirements do defp handle_result(:ok), do: :ok defp handle_result({:error, message}), do: raise(VerifyError, message: message) + defp check_welcome_message_config!(:ok) do + if Pleroma.Config.get([:welcome, :email, :enabled], false) and + not Pleroma.Emails.Mailer.enabled?() do + Logger.error(""" + To send welcome email do you need to enable mail. + \nconfig :pleroma, Pleroma.Emails.Mailer, enabled: true + """) + + {:error, "The mail disabled."} + else + :ok + end + end + + defp check_welcome_message_config!(result), do: result + # Checks account confirmation email # def check_confirmation_accounts!(:ok) do if Pleroma.Config.get([:instance, :account_activation_required]) && not Pleroma.Config.get([Pleroma.Emails.Mailer, :enabled]) do Logger.error( - "To use confirmation an user account need to enable and setting mailer.\nIf you want to start Pleroma anyway, set\nconfig :pleroma, :instance, account_activation_required: false\nOtherwise setup and enable mailer." + "Account activation enabled, but no Mailer settings enabled.\nPlease set config :pleroma, :instance, account_activation_required: false\nOtherwise setup and enable Mailer." ) - {:error, "Confirmation account: Mailer is disabled"} + {:error, + "Account activation enabled, but Mailer is disabled. Cannot send confirmation emails."} else :ok end