Merge branch 'develop' into tests/mastodon_api_controller.ex
[akkoma] / lib / pleroma / workers / digest_emails_worker.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Workers.DigestEmailsWorker do
6 alias Pleroma.User
7
8 use Pleroma.Workers.WorkerHelper, queue: "digest_emails"
9
10 @impl Oban.Worker
11 def perform(%{"op" => "digest_email", "user_id" => user_id}, _job) do
12 user_id
13 |> User.get_cached_by_id()
14 |> Pleroma.Daemons.DigestEmailDaemon.perform()
15 end
16 end