mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-23 00:14:48 +00:00
d98e68203e
With custom sentry reporting issues Signed-off-by: Thomas Citharel <tcit@tcit.fr>
34 lines
764 B
Elixir
34 lines
764 B
Elixir
defmodule Mobilizon.Web.Email.Mailer do
|
|
@moduledoc """
|
|
Mobilizon Mailer.
|
|
"""
|
|
use Bamboo.Mailer, otp_app: :mobilizon
|
|
|
|
def send_email_later(email) do
|
|
try do
|
|
Mobilizon.Web.Email.Mailer.deliver_later!(email)
|
|
rescue
|
|
error ->
|
|
Sentry.capture_exception(error,
|
|
stacktrace: __STACKTRACE__,
|
|
extra: %{extra: "Error while sending email"}
|
|
)
|
|
|
|
reraise error, __STACKTRACE__
|
|
end
|
|
end
|
|
|
|
def send_email(email) do
|
|
try do
|
|
Mobilizon.Web.Email.Mailer.deliver_now!(email)
|
|
rescue
|
|
error ->
|
|
Sentry.capture_exception(error,
|
|
stacktrace: __STACKTRACE__,
|
|
extra: %{extra: "Error while sending email"}
|
|
)
|
|
|
|
reraise error, __STACKTRACE__
|
|
end
|
|
end
|
|
end
|