logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

mailer_worker.ex (542B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Workers.MailerWorker do
  5. use Oban.Worker, queue: :background
  6. @impl true
  7. def perform(%Job{args: %{"op" => "email", "encoded_email" => encoded_email, "config" => config}}) do
  8. encoded_email
  9. |> Base.decode64!()
  10. |> :erlang.binary_to_term()
  11. |> Pleroma.Emails.Mailer.deliver(config)
  12. end
  13. @impl true
  14. def timeout(_job), do: :timer.seconds(5)
  15. end