diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-01-28 20:34:13 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-01-28 20:39:20 +0300 |
commit | 21a2a054070c26d7be1a0e453e5f40b20fbd59f2 (patch) | |
tree | af2812719f0485e8d844b1251f0de1be28673395 /lib/mix/tasks/pleroma/email.ex | |
parent | bfc70fdf29c2e1067179165ef686e6abe20896b0 (diff) | |
parent | e8f22451da18aeba9bcf9f9f6acf93690ccb3cba (diff) | |
download | pleroma-21a2a054070c26d7be1a0e453e5f40b20fbd59f2.tar.gz |
Merge branch 'develop' into issue/1383
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 |