forked from AkkomaGang/akkoma
added check user email for welcome email
This commit is contained in:
parent
5879d36854
commit
db0224d174
1 changed files with 2 additions and 1 deletions
|
@ -729,7 +729,7 @@ def send_welcome_message(user) do
|
||||||
end
|
end
|
||||||
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
|
if User.WelcomeEmail.enabled?() do
|
||||||
User.WelcomeEmail.send_email(user)
|
User.WelcomeEmail.send_email(user)
|
||||||
{:ok, :enqueued}
|
{:ok, :enqueued}
|
||||||
|
@ -737,6 +737,7 @@ def send_welcome_email(user) do
|
||||||
{:ok, :noop}
|
{:ok, :noop}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
def send_welcome_email(_), do: {:ok, :noop}
|
||||||
|
|
||||||
def try_send_confirmation_email(%User{} = user) do
|
def try_send_confirmation_email(%User{} = user) do
|
||||||
if user.confirmation_pending &&
|
if user.confirmation_pending &&
|
||||||
|
|
Loading…
Reference in a new issue