1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Emails.NewUsersDigestEmail do
6 use Phoenix.Swoosh, view: Pleroma.Web.EmailView, layout: {Pleroma.Web.LayoutView, :email_styled}
8 defp instance_notify_email do
9 Pleroma.Config.get([:instance, :notify_email]) || Pleroma.Config.get([:instance, :email])
12 def new_users(to, users_and_statuses) do
13 instance_name = Pleroma.Config.get([:instance, :name])
14 styling = Pleroma.Config.get([Pleroma.Emails.UserEmail, :styling])
17 Pleroma.Helpers.UriHelper.maybe_add_base(
18 Pleroma.Config.get([:frontend_configurations, :pleroma_fe, :logo]),
19 Pleroma.Web.Endpoint.url()
23 |> to({to.name, to.email})
24 |> from({instance_name, instance_notify_email()})
25 |> subject("#{instance_name} New Users")
26 |> render_body("new_users_digest.html", %{
28 users_and_statuses: users_and_statuses,
29 instance: instance_name,