mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-11-18 20:36:25 +01:00
8fda6303ba
Closes pleroma#1548
25 lines
580 B
Elixir
25 lines
580 B
Elixir
defmodule Mix.Tasks.Pleroma.Email do
|
|
use Mix.Task
|
|
import Mix.Pleroma
|
|
|
|
@shortdoc "Simple Email test"
|
|
@moduledoc File.read!("docs/administration/CLI_tasks/email.md")
|
|
|
|
def run(["test" | args]) do
|
|
Mix.Pleroma.start_pleroma()
|
|
|
|
{options, [], []} =
|
|
OptionParser.parse(
|
|
args,
|
|
strict: [
|
|
to: :string
|
|
]
|
|
)
|
|
|
|
email = Pleroma.Emails.AdminEmail.test_email(options[:to])
|
|
{:ok, _} = Pleroma.Emails.Mailer.deliver(email)
|
|
|
|
shell_info("Test email has been sent to #{inspect(email.to)} from #{inspect(email.from)}")
|
|
end
|
|
end
|