|
|
@ -34,15 +34,16 @@ defmodule Pleroma.ApplicationRequirements do
|
|
|
|
defp check_welcome_message_config!(:ok) do
|
|
|
|
defp check_welcome_message_config!(:ok) do
|
|
|
|
if Pleroma.Config.get([:welcome, :email, :enabled], false) and
|
|
|
|
if Pleroma.Config.get([:welcome, :email, :enabled], false) and
|
|
|
|
not Pleroma.Emails.Mailer.enabled?() do
|
|
|
|
not Pleroma.Emails.Mailer.enabled?() do
|
|
|
|
Logger.error("""
|
|
|
|
Logger.warn("""
|
|
|
|
To send welcome email do you need to enable mail.
|
|
|
|
To send welcome emails, you need to enable the mailer.
|
|
|
|
\nconfig :pleroma, Pleroma.Emails.Mailer, enabled: true
|
|
|
|
Welcome emails will NOT be sent with the current config.
|
|
|
|
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{:error, "The mail disabled."}
|
|
|
|
Enable the mailer:
|
|
|
|
else
|
|
|
|
config :pleroma, Pleroma.Emails.Mailer, enabled: true
|
|
|
|
:ok
|
|
|
|
""")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:ok
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
defp check_welcome_message_config!(result), do: result
|
|
|
|
defp check_welcome_message_config!(result), do: result
|
|
|
@ -51,18 +52,21 @@ defmodule Pleroma.ApplicationRequirements do
|
|
|
|
#
|
|
|
|
#
|
|
|
|
def check_confirmation_accounts!(:ok) do
|
|
|
|
def check_confirmation_accounts!(:ok) do
|
|
|
|
if Pleroma.Config.get([:instance, :account_activation_required]) &&
|
|
|
|
if Pleroma.Config.get([:instance, :account_activation_required]) &&
|
|
|
|
not Pleroma.Config.get([Pleroma.Emails.Mailer, :enabled]) do
|
|
|
|
not Pleroma.Emails.Mailer.enabled?() do
|
|
|
|
Logger.error(
|
|
|
|
Logger.warn("""
|
|
|
|
"Account activation enabled, but no Mailer settings enabled.\n" <>
|
|
|
|
Account activation is required, but the mailer is disabled.
|
|
|
|
"Please set config :pleroma, :instance, account_activation_required: false\n" <>
|
|
|
|
Users will NOT be able to confirm their accounts with this config.
|
|
|
|
"Otherwise setup and enable Mailer."
|
|
|
|
Either disable account activation or enable the mailer.
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{:error,
|
|
|
|
Disable account activation:
|
|
|
|
"Account activation enabled, but Mailer is disabled. Cannot send confirmation emails."}
|
|
|
|
config :pleroma, :instance, account_activation_required: false
|
|
|
|
else
|
|
|
|
|
|
|
|
:ok
|
|
|
|
Enable the mailer:
|
|
|
|
|
|
|
|
config :pleroma, Pleroma.Emails.Mailer, enabled: true
|
|
|
|
|
|
|
|
""")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:ok
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def check_confirmation_accounts!(result), do: result
|
|
|
|
def check_confirmation_accounts!(result), do: result
|
|
|
|