1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Mix.Tasks.Pleroma.Email do
9 @shortdoc "Email administrative tasks"
10 @moduledoc File.read!("docs/administration/CLI_tasks/email.md")
12 def run(["test" | args]) do
23 email = Pleroma.Emails.AdminEmail.test_email(options[:to])
24 {:ok, _} = Pleroma.Emails.Mailer.deliver(email)
26 shell_info("Test email has been sent to #{inspect(email.to)} from #{inspect(email.from)}")
29 def run(["resend_confirmation_emails"]) do
32 shell_info("Sending emails to all unconfirmed users")
34 Pleroma.User.Query.build(%{
40 |> Pleroma.Repo.chunk_stream(500)
41 |> Stream.each(&Pleroma.User.try_send_confirmation_email(&1))