X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Femails%2Fuser_email.ex;h=9346207658f2bc48491b06dfafe81e439004765a;hb=8be01540948ff62460a5c21663dfff6c358002a1;hp=8f916f47012cb4c616d5a12373f2b951fa4f4e7a;hpb=f69cbf4755b974de0303731327180bb51ed244fc;p=akkoma
diff --git a/lib/pleroma/emails/user_email.ex b/lib/pleroma/emails/user_email.ex
index 8f916f470..934620765 100644
--- a/lib/pleroma/emails/user_email.ex
+++ b/lib/pleroma/emails/user_email.ex
@@ -1,29 +1,30 @@
-defmodule Pleroma.UserEmail do
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Emails.UserEmail do
@moduledoc "User emails"
import Swoosh.Email
- alias Pleroma.Web.{Endpoint, Router}
+ alias Pleroma.Web.Endpoint
+ alias Pleroma.Web.Router
defp instance_config, do: Pleroma.Config.get(:instance)
defp instance_name, do: instance_config()[:name]
defp sender do
- {instance_name(), instance_config()[:email]}
+ email = Keyword.get(instance_config(), :notify_email, instance_config()[:email])
+ {instance_name(), email}
end
defp recipient(email, nil), do: email
defp recipient(email, name), do: {name, email}
defp recipient(%Pleroma.User{} = user), do: recipient(user.email, user.name)
- def password_reset_email(user, password_reset_token) when is_binary(password_reset_token) do
- password_reset_url =
- Router.Helpers.util_url(
- Endpoint,
- :show_password_reset,
- password_reset_token
- )
+ def password_reset_email(user, token) when is_binary(token) do
+ password_reset_url = Router.Helpers.reset_password_url(Endpoint, :reset, token)
html_body = """
Reset your password at #{instance_name()}