forked from AkkomaGang/akkoma
add email util tasks
This commit is contained in:
parent
32ce409514
commit
ed1ce20c5a
1 changed files with 22 additions and 0 deletions
|
@ -395,6 +395,28 @@ def run(["delete_activities", nickname]) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def run(["change_email", nickname, email]) do
|
||||||
|
start_pleroma()
|
||||||
|
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||||
|
user
|
||||||
|
|> User.update_changeset(%{"email" => email})
|
||||||
|
|> User.update_and_set_cache()
|
||||||
|
shell_info("#{nickname}'s email updated")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def run(["send_confirmation", nickname]) do
|
||||||
|
start_pleroma()
|
||||||
|
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||||
|
user
|
||||||
|
|> Pleroma.Emails.UserEmail.account_confirmation_email()
|
||||||
|
|> IO.inspect
|
||||||
|
|> Pleroma.Emails.Mailer.deliver!()
|
||||||
|
shell_info("#{nickname}'s email sent")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def run(["toggle_confirmed", nickname]) do
|
def run(["toggle_confirmed", nickname]) do
|
||||||
start_pleroma()
|
start_pleroma()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue