module Concerns::Notifications
  extend ActiveSupport::Concern

  included do
    def send_create_email!(current_user)
      if should_send_email_notification?(email, current_user)
        UserUpdateMailer.new_profile_email(
          self, current_user.email
        ).deliver_later
      end
    end

    def send_update_email!(current_user)
      if should_send_email_notification?(email, current_user)
        UserUpdateMailer.updated_profile_email(
          self, current_user.email
        ).deliver_later
      end
    end

    def send_destroy_email!(current_user)
      if should_send_email_notification?(email, current_user)
        UserUpdateMailer.deleted_profile_email(
          self, current_user.email
        ).deliver_later
      end
    end

  private

    def should_send_email_notification?(email, current_user)
      EmailAddress.new(email).valid_address? &&
        current_user.email != email
    end
  end
end

module Concerns::Notifications
  extend ActiveSupport::Concern

  included do
    def send_create_email!(current_user)
      if should_send_email_notification?(current_user)
        UserUpdateMailer.new_profile_email(
          self, current_user.email
        ).deliver_later
      end
    end

    def send_update_email!(current_user)
      if should_send_email_notification?(current_user)
        UserUpdateMailer.updated_profile_email(
          self, current_user.email
        ).deliver_later
      end
    end

    def send_destroy_email!(current_user)
      if should_send_email_notification?(current_user)
        UserUpdateMailer.deleted_profile_email(
          self, current_user.email
        ).deliver_later
      end
    end

  private

    def should_send_email_notification?(current_user)
      EmailAddress.new(email).valid_address? &&
        current_user.email != email
    end
  end
end

Use implicit email in Notifications
Use implicit email in Notifications

As this is mixed into the Person class, email is available. (And, in
fact, this is not appropriate as a Concern, but that will be addressed
in due course.)
