+ 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(
+ "Account activation enabled, but no Mailer settings enabled.\nPlease set config :pleroma, :instance, account_activation_required: false\nOtherwise setup and enable Mailer."
+ )
+
+ {:error,
+ "Account activation enabled, but Mailer is disabled. Cannot send confirmation emails."}
+ else
+ :ok
+ end
+ end
+
+ def check_confirmation_accounts!(result), do: result
+