mobilizon.chapril.org-mobil.../lib/web/email/mailer.ex

21 lines
519 B
Elixir
Raw Permalink Normal View History

2020-01-26 21:36:50 +01:00
defmodule Mobilizon.Web.Email.Mailer do
@moduledoc """
2019-09-07 23:58:53 +02:00
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