X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fworkers%2Fcron%2Fnew_users_digest_worker.ex;h=9dfd922284a74249fb008c1b287845e108b65fce;hb=1dc5794e2996d09dee22f0156c4a442c8338aa8d;hp=951c2c0540a516cce9718b8e40475a2c9cbef4d8;hpb=3eddd9caa61a2ac431eb57cd4c835db608702a7d;p=akkoma
diff --git a/lib/pleroma/workers/cron/new_users_digest_worker.ex b/lib/pleroma/workers/cron/new_users_digest_worker.ex
index 951c2c054..9dfd92228 100644
--- a/lib/pleroma/workers/cron/new_users_digest_worker.ex
+++ b/lib/pleroma/workers/cron/new_users_digest_worker.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do
@@ -12,7 +12,7 @@ defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do
use Pleroma.Workers.WorkerHelper, queue: "new_users_digest"
@impl Oban.Worker
- def perform(_args, _job) do
+ def perform(_job) do
if Pleroma.Config.get([Pleroma.Emails.NewUsersDigestEmail, :enabled]) do
today = NaiveDateTime.utc_now() |> Timex.beginning_of_day()
@@ -51,10 +51,13 @@ defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do
if users_and_statuses != [] do
%{is_admin: true}
|> User.Query.build()
+ |> where([u], not is_nil(u.email))
|> Repo.all()
|> Enum.map(&Pleroma.Emails.NewUsersDigestEmail.new_users(&1, users_and_statuses))
|> Enum.each(&Pleroma.Emails.Mailer.deliver/1)
end
end
+
+ :ok
end
end