Add "Your backup is ready" email

This commit is contained in:
Egor Kislitsyn 2020-09-17 18:42:24 +04:00
commit 7fdd81d000
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
3 changed files with 25 additions and 2 deletions

View file

@ -34,7 +34,11 @@ defmodule Pleroma.Workers.BackupWorker do
with {:ok, %Backup{} = backup} <-
backup_id |> Backup.get() |> Backup.process(),
{:ok, _job} <- schedule_deletion(backup),
:ok <- Backup.remove_outdated(backup) do
:ok <- Backup.remove_outdated(backup),
{:ok, _} <-
backup
|> Pleroma.Emails.UserEmail.backup_is_ready_email()
|> Pleroma.Emails.Mailer.deliver() do
{:ok, backup}
end
end