diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-01-20 13:23:21 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-01-28 16:49:38 +0100 |
commit | 4eb935be78eeaf1decb7fc109cec09ca18d82854 (patch) | |
tree | 4be2d8c3c0edce50783de984123c6a563affb018 /lib/pleroma/emails | |
parent | b12f3064730648de992f934cf5a23cadb5206b9d (diff) | |
download | pleroma-4eb935be78eeaf1decb7fc109cec09ca18d82854.tar.gz |
Create pleroma.email mix task
Closes: https://git.pleroma.social/pleroma/pleroma/issues/1061
Diffstat (limited to 'lib/pleroma/emails')
-rw-r--r-- | lib/pleroma/emails/admin_email.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pleroma/emails/admin_email.ex b/lib/pleroma/emails/admin_email.ex index b15e4041b..b3623d3e4 100644 --- a/lib/pleroma/emails/admin_email.ex +++ b/lib/pleroma/emails/admin_email.ex @@ -7,6 +7,7 @@ defmodule Pleroma.Emails.AdminEmail do import Swoosh.Email + alias Pleroma.Config alias Pleroma.Web.Router.Helpers defp instance_config, do: Pleroma.Config.get(:instance) @@ -20,6 +21,19 @@ defmodule Pleroma.Emails.AdminEmail do Helpers.feed_url(Pleroma.Web.Endpoint, :feed_redirect, user.id) end + def test_email(mail_to \\ nil) do + html_body = """ + <h3>Instance Test Email</h3> + <p>A test email was requested. Hello. :)</p> + """ + + new() + |> to(mail_to || Config.get([:instance, :email])) + |> from({instance_name(), instance_notify_email()}) + |> subject("Instance Test Email") + |> html_body(html_body) + end + def report(to, reporter, account, statuses, comment) do comment_html = if comment do |