projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ConnectionPool.Worker: Open gun conn in continue instead of init
[akkoma]
/
lib
/
pleroma
/
emails
/
mailer.ex
diff --git
a/lib/pleroma/emails/mailer.ex
b/lib/pleroma/emails/mailer.ex
index 2e4657b7c33b4a1ce9762f5a0e6facc80dfe9e53..8b1bdef754d0a0b23c0a7727ef4fc9b15dc05d6e 100644
(file)
--- a/
lib/pleroma/emails/mailer.ex
+++ b/
lib/pleroma/emails/mailer.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.Mailer do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.Mailer do
@@
-9,6
+9,7
@@
defmodule Pleroma.Emails.Mailer do
The module contains functions to delivery email using Swoosh.Mailer.
"""
The module contains functions to delivery email using Swoosh.Mailer.
"""
+ alias Pleroma.Workers.MailerWorker
alias Swoosh.DeliveryError
@otp_app :pleroma
alias Swoosh.DeliveryError
@otp_app :pleroma
@@
-19,7
+20,12
@@
defmodule Pleroma.Emails.Mailer do
@doc "add email to queue"
def deliver_async(email, config \\ []) do
@doc "add email to queue"
def deliver_async(email, config \\ []) do
- PleromaJobQueue.enqueue(:mailer, __MODULE__, [:deliver_async, email, config])
+ encoded_email =
+ email
+ |> :erlang.term_to_binary()
+ |> Base.encode64()
+
+ MailerWorker.enqueue("email", %{"encoded_email" => encoded_email, "config" => config})
end
@doc "callback to perform send email from queue"
end
@doc "callback to perform send email from queue"