From db0224d1745e753b73bd0e993bc0e75eec295651 Mon Sep 17 00:00:00 2001 From: Maksim Pechnikov Date: Wed, 22 Jul 2020 16:00:49 +0300 Subject: [PATCH] added check user email for welcome email --- lib/pleroma/user.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 29526b8fd..5bc256b50 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -729,7 +729,7 @@ defmodule Pleroma.User do end end - def send_welcome_email(user) do + def send_welcome_email(%User{email: email} = user) when is_binary(email) do if User.WelcomeEmail.enabled?() do User.WelcomeEmail.send_email(user) {:ok, :enqueued} @@ -737,6 +737,7 @@ defmodule Pleroma.User do {:ok, :noop} end end + def send_welcome_email(_), do: {:ok, :noop} def try_send_confirmation_email(%User{} = user) do if user.confirmation_pending && -- 2.45.2