diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 08beae05d..bbfecfca6 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -4,6 +4,11 @@ class ContactMailer < ApplicationMailer def email_updated(old_email, email, contact_id, should_deliver) @contact = Contact.find_by(id: contact_id) @old_email = old_email + unless @contact + Rails.logger.info "Cannot send email in #{self.class.name}##{__method__} with contact_id #{contact_id}. It cannot be found" + return + end + return unless email || @contact return if delivery_off?(@contact, should_deliver)