aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/pleroma/email.ex
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-01-28 21:11:13 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-01-28 21:11:13 +0300
commitba5e8a644463a19b863e862def80adb6a5a1060b (patch)
treeb00fdfbfe13979454dcad185e8c0c7de237d8a0f /lib/mix/tasks/pleroma/email.ex
parente442ea5722404ca551135b6f4767c016952bbda3 (diff)
parentf1d5c0f07963c23d264311985c21837b9b03fd5a (diff)
downloadpleroma-ba5e8a644463a19b863e862def80adb6a5a1060b.tar.gz
Merge branch 'develop' into issue/1276
Diffstat (limited to 'lib/mix/tasks/pleroma/email.ex')
-rw-r--r--lib/mix/tasks/pleroma/email.ex25
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