X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fapplication_requirements.ex;h=16f62b6f5d43e00caa18e612479f66e82bffcaae;hb=33e508d7c6bae4f2b48568c50e1573fb4cbcffd3;hp=ee88c3346e6398775c28a38412e93a43bd5ee78b;hpb=250e0369c72292a255b0fe078e5a2202c00fa4c7;p=akkoma diff --git a/lib/pleroma/application_requirements.ex b/lib/pleroma/application_requirements.ex index ee88c3346..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,6 +26,22 @@ 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