mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-27 18:31:07 +00:00
a4cc566ee7
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
20 lines
519 B
Elixir
20 lines
519 B
Elixir
defmodule Mobilizon.Web.Email.Mailer do
|
|
@moduledoc """
|
|
Mobilizon Mailer.
|
|
"""
|
|
use Swoosh.Mailer, otp_app: :mobilizon
|
|
alias Mobilizon.Service.ErrorReporting.Sentry
|
|
|
|
@spec send_email(Swoosh.Email.t()) :: {:ok, term} | {:error, term}
|
|
def send_email(email) do
|
|
Mobilizon.Web.Email.Mailer.deliver(email)
|
|
rescue
|
|
error ->
|
|
Sentry.capture_exception(error,
|
|
stacktrace: __STACKTRACE__,
|
|
extra: %{extra: "Error while sending email"}
|
|
)
|
|
|
|
reraise error, __STACKTRACE__
|
|
end
|
|
end
|