diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-01-28 21:11:13 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-01-28 21:11:13 +0300 |
commit | ba5e8a644463a19b863e862def80adb6a5a1060b (patch) | |
tree | b00fdfbfe13979454dcad185e8c0c7de237d8a0f /lib/mix | |
parent | e442ea5722404ca551135b6f4767c016952bbda3 (diff) | |
parent | f1d5c0f07963c23d264311985c21837b9b03fd5a (diff) | |
download | pleroma-ba5e8a644463a19b863e862def80adb6a5a1060b.tar.gz |
Merge branch 'develop' into issue/1276
Diffstat (limited to 'lib/mix')
-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 |