mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-13 14:12:11 +00:00
26 lines
577 B
Elixir
26 lines
577 B
Elixir
|
defmodule Mix.Tasks.Pleroma.Email do
|
||
|
use Mix.Task
|
||
|
|
||
|
@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)
|
||
|
|
||
|
Mix.shell().info(
|
||
|
"Test email has been sent to #{inspect(email.to)} from #{inspect(email.from)}"
|
||
|
)
|
||
|
end
|
||
|
end
|