aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/pleroma/email.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-02-05 07:56:36 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-02-05 07:56:36 +0300
commite84fee5b8624c8909ddd8a7e0d99c6beea4f54d0 (patch)
treed0d2bfc3d847f9bb4fa03f08d9d60f49042b2688 /lib/mix/tasks/pleroma/email.ex
parent86e4d23acb640efea8cbc879ddbeadfa0e04f9c8 (diff)
parenta56db789359c7c7d57b45e6c68f791eeadc171e4 (diff)
downloadpleroma-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.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