projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for info after tag/untag user
[akkoma]
/
lib
/
mix
/
tasks
/
pleroma
/
digest.ex
diff --git
a/lib/mix/tasks/pleroma/digest.ex
b/lib/mix/tasks/pleroma/digest.ex
index 430116a505e4db3229ea0457f01d97f03c07529e..8bde2d4f290bdd848db42a14302a90bf11c4fcdb 100644
(file)
--- a/
lib/mix/tasks/pleroma/digest.ex
+++ b/
lib/mix/tasks/pleroma/digest.ex
@@
-1,19
+1,14
@@
defmodule Mix.Tasks.Pleroma.Digest do
use Mix.Task
defmodule Mix.Tasks.Pleroma.Digest do
use Mix.Task
+ import Mix.Pleroma
@shortdoc "Manages digest emails"
@shortdoc "Manages digest emails"
- @moduledoc """
- Manages digest emails
+ @moduledoc File.read!("docs/administration/CLI_tasks/digest.md")
- ## Send digest email since given date (user registration date by default)
- ignoring user activity status.
-
- ``mix pleroma.digest test <nickname> <since_date>``
-
- Example: ``mix pleroma.digest test donaldtheduck 2019-05-20``
- """
def run(["test", nickname | opts]) do
Mix.Pleroma.start_pleroma()
def run(["test", nickname | opts]) do
Mix.Pleroma.start_pleroma()
+ Application.ensure_all_started(:timex)
+ Application.ensure_all_started(:swoosh)
user = Pleroma.User.get_by_nickname(nickname)
user = Pleroma.User.get_by_nickname(nickname)
@@
-30,12
+25,10
@@
defmodule Mix.Tasks.Pleroma.Digest do
with %Swoosh.Email{} = email <- Pleroma.Emails.UserEmail.digest_email(patched_user) do
{:ok, _} = Pleroma.Emails.Mailer.deliver(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})")
+
shell_
info("Digest email have been sent to #{nickname} (#{user.email})")
else
_ ->
else
_ ->
- Mix.shell().info(
- "Cound't find any mentions for #{nickname} since #{last_digest_emailed_at}"
- )
+ shell_info("Cound't find any mentions for #{nickname} since #{last_digest_emailed_at}")
end
end
end
end
end
end