emails: fix sending emails to invalid addresses.

Fix mailers to not attempt deliveries to invalid or nonexistent email
addresses. This usually happened when someone changed their email, and
we tried to send a confirmation email to a nonexistent address.
This commit is contained in:
evazion
2022-01-02 12:23:01 -06:00
parent 9ffc269e43
commit 32613f9bb1
8 changed files with 30 additions and 13 deletions

View File

@@ -90,7 +90,7 @@ class UsersController < ApplicationController
flash[:notice] = "Sign up failed: #{@user.errors.full_messages.join("; ")}"
else
session[:user_id] = @user.id
UserMailer.welcome_user(@user).deliver_later if @user.can_receive_email?(require_verification: false)
UserMailer.welcome_user(@user).deliver_later
set_current_user
end