diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-02-05 07:56:36 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-02-05 07:56:36 +0300 |
commit | e84fee5b8624c8909ddd8a7e0d99c6beea4f54d0 (patch) | |
tree | d0d2bfc3d847f9bb4fa03f08d9d60f49042b2688 /lib/mix/tasks/pleroma/email.ex | |
parent | 86e4d23acb640efea8cbc879ddbeadfa0e04f9c8 (diff) | |
parent | a56db789359c7c7d57b45e6c68f791eeadc171e4 (diff) | |
download | pleroma-e84fee5b8624c8909ddd8a7e0d99c6beea4f54d0.tar.gz |
Merge remote-tracking branch 'remotes/origin/develop' into 1505-threads-federation
Diffstat (limited to 'lib/mix/tasks/pleroma/email.ex')
-rw-r--r-- | lib/mix/tasks/pleroma/email.ex | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/mix/tasks/pleroma/email.ex b/lib/mix/tasks/pleroma/email.ex new file mode 100644 index 000000000..2c3801429 --- /dev/null +++ b/lib/mix/tasks/pleroma/email.ex @@ -0,0 +1,25 @@ +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 |