Merge branch 'docs/debian-packages' into 'develop'
[akkoma] / lib / pleroma / workers / mailer_worker.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Workers.MailerWorker do
6 use Pleroma.Workers.WorkerHelper, queue: "mailer"
7
8 @impl Oban.Worker
9 def perform(%{"op" => "email", "encoded_email" => encoded_email, "config" => config}, _job) do
10 encoded_email
11 |> Base.decode64!()
12 |> :erlang.binary_to_term()
13 |> Pleroma.Emails.Mailer.deliver(config)
14 end
15 end