s/Pleroma.UserEmail/Pleroma.Emails.UserEmail/
This commit is contained in:
parent
cae0231731
commit
9c1b36856b
7 changed files with 17 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -279,7 +279,7 @@ def try_send_confirmation_email(%User{} = 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}
|
||||
|
|
|
@ -237,7 +237,12 @@ def email_invite(%{assigns: %{user: user}} = conn, %{"email" => email} = params)
|
|||
!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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -317,7 +317,7 @@ test "sends invitation and returns 204", %{conn: conn, user: user} 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,
|
||||
|
|
|
@ -1064,7 +1064,7 @@ test "it sends an email to user", %{user: user} 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 @@ test "it sends confirmation email", %{conn: conn, user: user} 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
|
||||
|
||||
|
|
|
@ -321,7 +321,9 @@ test "it sends confirmation email if :account_activation_required is specified i
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue