X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fmix%2Ftasks%2Fpleroma%2Femail.ex;h=d257cebe96fd262d09e4d61763f52973d98010db;hb=ca1accc1cf6689fc52a897003b5e297f51fefaf6;hp=0e4c87598d689d71a10bda6720a48fd9525302f9;hpb=935ef21b0285975b08037827a33f32bfcbbff951;p=akkoma diff --git a/lib/mix/tasks/pleroma/email.ex b/lib/mix/tasks/pleroma/email.ex index 0e4c87598..d257cebe9 100644 --- a/lib/mix/tasks/pleroma/email.ex +++ b/lib/mix/tasks/pleroma/email.ex @@ -1,9 +1,13 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Mix.Tasks.Pleroma.Email do use Mix.Task import Mix.Pleroma @shortdoc "Email administrative tasks" - @moduledoc File.read!("docs/administration/CLI_tasks/email.md") + @moduledoc File.read!("docs/docs/administration/CLI_tasks/email.md") def run(["test" | args]) do start_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, :batches) - |> Stream.each(&Pleroma.User.try_send_confirmation_email(&1)) + |> Pleroma.Repo.chunk_stream(500) + |> Stream.each(&Pleroma.User.maybe_send_confirmation_email(&1)) |> Stream.run() end end