Add a message with a count of posts to index
[akkoma] / lib / mix / tasks / pleroma / email.ex
index 9e989ed465b05295c16e4b34b8bb6f275f95b553..4ce8c9b05fc7fc0f9ed48b60b4fdece26403c536 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Mix.Tasks.Pleroma.Email do
   use Mix.Task
   import Mix.Pleroma
@@ -25,14 +29,16 @@ defmodule Mix.Tasks.Pleroma.Email do
   def run(["resend_confirmation_emails"]) do
     start_pleroma()
 
+    shell_info("Sending emails to all unconfirmed users")
+
     Pleroma.User.Query.build(%{
       local: true,
-      deactivated: false,
-      confirmation_pending: true,
+      is_active: true,
+      is_confirmed: false,
       invisible: false
     })
     |> Pleroma.Repo.chunk_stream(500)
-    |> Stream.each(&Pleroma.User.try_send_confirmation_email(&1))
+    |> Stream.each(&Pleroma.User.maybe_send_confirmation_email(&1))
     |> Stream.run()
   end
 end