[#2497] Specified SHELL in .gitlab-ci.yml as required for `exexec`.
[akkoma] / lib / pleroma / emails / new_users_digest_email.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Emails.NewUsersDigestEmail do
6 use Phoenix.Swoosh, view: Pleroma.Web.EmailView, layout: {Pleroma.Web.LayoutView, :email_styled}
7
8 defp instance_notify_email do
9 Pleroma.Config.get([:instance, :notify_email]) || Pleroma.Config.get([:instance, :email])
10 end
11
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])
15
16 logo_url =
17 Pleroma.Web.Endpoint.url() <>
18 Pleroma.Config.get([:frontend_configurations, :pleroma_fe, :logo])
19
20 new()
21 |> to({to.name, to.email})
22 |> from({instance_name, instance_notify_email()})
23 |> subject("#{instance_name} New Users")
24 |> render_body("new_users_digest.html", %{
25 title: "New Users",
26 users_and_statuses: users_and_statuses,
27 instance: instance_name,
28 styling: styling,
29 logo_url: logo_url
30 })
31 end
32 end