Disable NewUsersDigestEmail by default

This commit is contained in:
Egor Kislitsyn 2020-01-22 20:53:06 +04:00
parent df0b8f1d08
commit aa0f0d4edd
No known key found for this signature in database
GPG Key ID: 1B49CB15B71E7805
3 changed files with 41 additions and 35 deletions

View File

@ -581,6 +581,8 @@
text_muted_color: "#b9b9ba" text_muted_color: "#b9b9ba"
} }
config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: false
config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics" config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
config :pleroma, Pleroma.ScheduledActivity, config :pleroma, Pleroma.ScheduledActivity,

View File

@ -97,6 +97,8 @@
config :pleroma, :modules, runtime_dir: "test/fixtures/modules" config :pleroma, :modules, runtime_dir: "test/fixtures/modules"
config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
if File.exists?("./config/test.secret.exs") do if File.exists?("./config/test.secret.exs") do
import_config "test.secret.exs" import_config "test.secret.exs"
else else

View File

@ -13,6 +13,7 @@ defmodule Pleroma.Workers.NewUsersDigestWorker do
@impl Oban.Worker @impl Oban.Worker
def perform(_args, _job) do def perform(_args, _job) do
if Pleroma.Config.get([Pleroma.Emails.NewUsersDigestEmail, :enabled]) do
today = NaiveDateTime.utc_now() |> Timex.beginning_of_day() today = NaiveDateTime.utc_now() |> Timex.beginning_of_day()
a_day_ago = a_day_ago =
@ -53,4 +54,5 @@ def perform(_args, _job) do
|> Enum.map(&Pleroma.Emails.NewUsersDigestEmail.new_users(&1, users_and_statuses)) |> Enum.map(&Pleroma.Emails.NewUsersDigestEmail.new_users(&1, users_and_statuses))
|> Enum.each(&Pleroma.Emails.Mailer.deliver/1) |> Enum.each(&Pleroma.Emails.Mailer.deliver/1)
end end
end
end end