+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Mix.Tasks.Pleroma.Email do
use Mix.Task
import Mix.Pleroma
@moduledoc File.read!("docs/administration/CLI_tasks/email.md")
def run(["test" | args]) do
- Mix.Pleroma.start_pleroma()
+ start_pleroma()
{options, [], []} =
OptionParser.parse(
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,
invisible: false
})
- |> Pleroma.RepoStreamer.chunk_stream(500)
- |> Stream.each(fn users ->
- users
- |> Enum.each(fn user -> Pleroma.User.try_send_confirmation_email(user) end)
- end)
+ |> Pleroma.Repo.chunk_stream(500)
+ |> Stream.each(&Pleroma.User.try_send_confirmation_email(&1))
|> Stream.run()
end
end