aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/pleroma/digest.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-08-22 20:59:58 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-08-22 20:59:58 +0300
commit256ff09aa8068166a9f83e3159f060fd4598af76 (patch)
treea5e5efa83241f28d8d241b9d2d95ca4ceaefd286 /lib/mix/tasks/pleroma/digest.ex
parent8778c16dac1789eeb6dd51524573163216200b5d (diff)
parent73884441f31092bdb2f509950daf9bd3889a9a8b (diff)
downloadpleroma-256ff09aa8068166a9f83e3159f060fd4598af76.tar.gz
[#1149] Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
# Conflicts: # lib/pleroma/application.ex # lib/pleroma/scheduled_activity_worker.ex # lib/pleroma/web/federator/retry_queue.ex # lib/pleroma/web/oauth/token/clean_worker.ex # test/user_test.exs # test/web/federator_test.exs
Diffstat (limited to 'lib/mix/tasks/pleroma/digest.ex')
-rw-r--r--lib/mix/tasks/pleroma/digest.ex12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/mix/tasks/pleroma/digest.ex b/lib/mix/tasks/pleroma/digest.ex
index 81c207e10..430116a50 100644
--- a/lib/mix/tasks/pleroma/digest.ex
+++ b/lib/mix/tasks/pleroma/digest.ex
@@ -27,7 +27,15 @@ defmodule Mix.Tasks.Pleroma.Digest do
patched_user = %{user | last_digest_emailed_at: last_digest_emailed_at}
- _user = Pleroma.DigestEmailWorker.perform(patched_user)
- Mix.shell().info("Digest email have been sent to #{nickname} (#{user.email})")
+ with %Swoosh.Email{} = email <- Pleroma.Emails.UserEmail.digest_email(patched_user) do
+ {:ok, _} = Pleroma.Emails.Mailer.deliver(email)
+
+ Mix.shell().info("Digest email have been sent to #{nickname} (#{user.email})")
+ else
+ _ ->
+ Mix.shell().info(
+ "Cound't find any mentions for #{nickname} since #{last_digest_emailed_at}"
+ )
+ end
end
end