[#114] Naive implementation of email invitations.
This commit is contained in:
parent
30dc81667c
commit
cc83d7ffe7
3 changed files with 63 additions and 0 deletions
|
|
@ -333,6 +333,16 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
end
|
||||
end
|
||||
|
||||
def confirm_email(_conn, _params), do: :noop
|
||||
|
||||
def email_invite(%{assigns: %{user: user}} = conn, %{"email" => email} = params) do
|
||||
with true <- Pleroma.Config.get([:instance, :invites_enabled]),
|
||||
email <- Pleroma.UserEmail.user_invitation_email(user, email, params["name"]),
|
||||
{:ok, _} <- Pleroma.Mailer.deliver(email) do
|
||||
json_response(conn, :no_content, "")
|
||||
end
|
||||
end
|
||||
|
||||
def update_avatar(%{assigns: %{user: user}} = conn, params) do
|
||||
{:ok, object} = ActivityPub.upload(params, type: :avatar)
|
||||
change = Changeset.change(user, %{avatar: object.data})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue