[#114] Initial implementation of user email invitations.
This commit is contained in:
parent
908943352f
commit
00744c6b03
4 changed files with 67 additions and 5 deletions
|
|
@ -168,7 +168,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
private: if(Keyword.get(instance, :public, true), do: "0", else: "1"),
|
||||
accountActivationRequired:
|
||||
if(Keyword.get(instance, :account_activation_required, false), do: "1", else: "0"),
|
||||
invitesEnabled: if(Keyword.get(instance, :invites_enabled, true), do: "1", else: "0"),
|
||||
invitesEnabled: if(Keyword.get(instance, :invites_enabled, false), do: "1", else: "0"),
|
||||
vapidPublicKey: vapid_public_key
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -335,7 +335,13 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
|
||||
def confirm_email(_conn, _params), do: :noop
|
||||
|
||||
def email_invite(_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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue