s/Pleroma.UserEmail/Pleroma.Emails.UserEmail/
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Wed, 10 Apr 2019 04:14:37 +0000 (06:14 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Wed, 10 Apr 2019 04:33:20 +0000 (06:33 +0200)
lib/pleroma/emails/user_email.ex
lib/pleroma/user.ex
lib/pleroma/web/admin_api/admin_api_controller.ex
lib/pleroma/web/twitter_api/twitter_api.ex
test/web/admin_api/admin_api_controller_test.exs
test/web/twitter_api/twitter_api_controller_test.exs
test/web/twitter_api/twitter_api_test.exs

index a3a09e96cccebda630c8ee86b4c534789dc7e949..f475ebb9ffa5c7d76105aaadc810aaeb69fa5e03 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.UserEmail do
+defmodule Pleroma.Emails.UserEmail do
   @moduledoc "User emails"
 
   import Swoosh.Email
index 8cf69c591c45d4b3b33576a1cfcc516e9e609a3d..0d25cf74c0b352cfc452afcd589b4d0474788045 100644 (file)
@@ -279,7 +279,7 @@ defmodule Pleroma.User do
     if user.info.confirmation_pending &&
          Pleroma.Config.get([:instance, :account_activation_required]) do
       user
-      |> Pleroma.UserEmail.account_confirmation_email()
+      |> Pleroma.Emails.UserEmail.account_confirmation_email()
       |> Pleroma.Emails.Mailer.deliver_async()
     else
       {:ok, :noop}
index 3679b502bd09d797535135ac9db14150b724f632..3366e7275ca79f26abd4246d963f3a25ca61512c 100644 (file)
@@ -237,7 +237,12 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
              !Pleroma.Config.get([:instance, :registrations_open]),
          {:ok, invite_token} <- Pleroma.UserInviteToken.create_token(),
          email <-
-           Pleroma.UserEmail.user_invitation_email(user, invite_token, email, params["name"]),
+           Pleroma.Emails.UserEmail.user_invitation_email(
+             user,
+             invite_token,
+             email,
+             params["name"]
+           ),
          {:ok, _} <- Pleroma.Emails.Mailer.deliver(email) do
       json_response(conn, :no_content, "")
     end
index bf216a18f6fc886a6fb1c9217d984b854ed99db5..a69bd0a54ff20b1f6607f02602daf414f2f45fdf 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
   alias Pleroma.Activity
   alias Pleroma.Emails.Mailer
+  alias Pleroma.Emails.UserEmail
   alias Pleroma.Repo
   alias Pleroma.User
-  alias Pleroma.UserEmail
   alias Pleroma.UserInviteToken
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.CommonAPI
index ca6bd0e9764caa4fee6d7a55899ba2dcbb82f86f..2a8791b83502c08f1b8ea85634d669ddc53392a1 100644 (file)
@@ -317,7 +317,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
       refute token_record.used
 
       Swoosh.TestAssertions.assert_email_sent(
-        Pleroma.UserEmail.user_invitation_email(
+        Pleroma.Emails.UserEmail.user_invitation_email(
           user,
           token_record,
           recipient_email,
index 72b7ea85eba8e001cde0a212aa8a73ca9f09d464..b3e01e94325caf16c7da30aefebc15b5a6fb8a14 100644 (file)
@@ -1064,7 +1064,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
       token_record = Repo.get_by(Pleroma.PasswordResetToken, user_id: user.id)
 
       Swoosh.TestAssertions.assert_email_sent(
-        Pleroma.UserEmail.password_reset_email(user, token_record.token)
+        Pleroma.Emails.UserEmail.password_reset_email(user, token_record.token)
       )
     end
   end
@@ -1163,7 +1163,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
       |> assign(:user, user)
       |> post("/api/account/resend_confirmation_email?email=#{user.email}")
 
-      Swoosh.TestAssertions.assert_email_sent(Pleroma.UserEmail.account_confirmation_email(user))
+      Swoosh.TestAssertions.assert_email_sent(
+        Pleroma.Emails.UserEmail.account_confirmation_email(user)
+      )
     end
   end
 
index 6c00244deb70ff1a8ffa866c4a76c9ddee2e30a1..fcb3fd8bd9ecc0a4cdf024e2f5f301d80277f42b 100644 (file)
@@ -321,7 +321,9 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
 
     assert user.info.confirmation_pending
 
-    Swoosh.TestAssertions.assert_email_sent(Pleroma.UserEmail.account_confirmation_email(user))
+    Swoosh.TestAssertions.assert_email_sent(
+      Pleroma.Emails.UserEmail.account_confirmation_email(user)
+    )
   end
 
   test "it registers a new user and parses mentions in the bio" do