@@ -5,30 +5,26 @@ defmodule Mobilizon.Web.Email.Mailer do
|
||||
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"}
|
||||
)
|
||||
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
|
||||
reraise error, __STACKTRACE__
|
||||
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"}
|
||||
)
|
||||
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
|
||||
reraise error, __STACKTRACE__
|
||||
end
|
||||
end
|
||||
|
||||
@@ -80,7 +80,7 @@ defmodule Mobilizon.Web.Email.User do
|
||||
Users.update_user(user, %{
|
||||
"confirmation_sent_at" => DateTime.utc_now() |> DateTime.truncate(:second)
|
||||
}),
|
||||
{:ok, %Bamboo.Email{}} <- send_confirmation_email(user, locale) do
|
||||
%Bamboo.Email{} <- send_confirmation_email(user, locale) do
|
||||
Logger.info("Sent confirmation email again to #{user.email}")
|
||||
{:ok, user.email}
|
||||
end
|
||||
@@ -132,7 +132,7 @@ defmodule Mobilizon.Web.Email.User do
|
||||
"reset_password_sent_at" => DateTime.utc_now() |> DateTime.truncate(:second)
|
||||
})
|
||||
),
|
||||
{:ok, %Bamboo.Email{} = mail} <-
|
||||
%Bamboo.Email{} = mail <-
|
||||
user_updated
|
||||
|> Email.User.reset_password_email(locale)
|
||||
|> Email.Mailer.send_email_later() do
|
||||
|
||||
Reference in New Issue
Block a user