X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Femails%2Fadmin_email.ex;h=d5757c12a6403e6b7d16a8c08396a9643703f0bd;hb=e2bf6b1f7ee6115a7eafa78272bdbafe7f4789c5;hp=aa0b2a66ba6724b95c8a304b4908e56d55b61966;hpb=5ea638757210c34b40fb568e537082b78f4118a6;p=akkoma diff --git a/lib/pleroma/emails/admin_email.ex b/lib/pleroma/emails/admin_email.ex index aa0b2a66b..d5757c12a 100644 --- a/lib/pleroma/emails/admin_email.ex +++ b/lib/pleroma/emails/admin_email.ex @@ -8,6 +8,7 @@ defmodule Pleroma.Emails.AdminEmail do import Swoosh.Email alias Pleroma.Config + alias Pleroma.HTML alias Pleroma.Web.Router.Helpers defp instance_config, do: Config.get(:instance) @@ -17,10 +18,6 @@ defmodule Pleroma.Emails.AdminEmail do Keyword.get(instance_config(), :notify_email, instance_config()[:email]) end - defp user_url(user) do - Helpers.user_feed_url(Pleroma.Web.Endpoint, :feed_redirect, user.id) - end - def test_email(mail_to \\ nil) do html_body = """

Instance Test Email

@@ -51,6 +48,9 @@ defmodule Pleroma.Emails.AdminEmail do status_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, id) "
  • #{status_url}
  • " + %{"id" => id} when is_binary(id) -> + "
  • #{id}
  • " + id when is_binary(id) -> "
  • #{id}
  • " end) @@ -68,8 +68,8 @@ defmodule Pleroma.Emails.AdminEmail do end html_body = """ -

    Reported by: #{reporter.nickname}

    -

    Reported Account: #{account.nickname}

    +

    Reported by: #{reporter.nickname}

    +

    Reported Account: #{account.nickname}

    #{comment_html} #{statuses_html}

    @@ -82,4 +82,18 @@ defmodule Pleroma.Emails.AdminEmail do |> subject("#{instance_name()} Report") |> html_body(html_body) end + + def new_unapproved_registration(to, account) do + html_body = """ +

    New account for review: @#{account.nickname}

    +
    #{HTML.strip_tags(account.registration_reason)}
    + Visit AdminFE + """ + + new() + |> to({to.name, to.email}) + |> from({instance_name(), instance_notify_email()}) + |> subject("New account up for review on #{instance_name()} (@#{account.nickname})") + |> html_body(html_body) + end end