You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: email_reminder_job.rb
    path of file: ./repos/identity-idp/app/jobs/in_person
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module InPerson
  class EmailReminderJob < ApplicationJob
    EMAIL_TYPE_EARLY = 'early'
    EMAIL_TYPE_LATE = 'late'

    queue_as :low

    def perform(_now)
      return true unless IdentityConfig.store.in_person_proofing_enabled

      # send late emails first in case of job failure
      late_enrollments = InPersonEnrollment.needs_late_email_reminder(
        late_benchmark,
        final_benchmark,
      
    
    def send_emails_for_enrollments(enrollments:, email_type:)
      enrollments.each do |enrollment|
        send_reminder_email(enrollment.user, enrollment)
      rescue StandardError => err
        NewRelic::Agent.notice_error(err)
        analytics(user: enrollment.user).idv_in_person_email_reminder_job_exception(
          enrollment_id: enrollment.id,
          exception_class: err.class.to_s,
          exception_message: err.message,
        )
      else
        analytics(user: enrollment.user).idv_in_person_email_reminder_job_email_initiated(
          email_type: email_type,
          enrollment_id: enrollment.id,
        )
        if email_type == EMAIL_TYPE_EARLY
          enrollment.update!(early_reminder_sent: true)
        elsif email_type == EMAIL_TYPE_LATE
          enrollment.update!(late_reminder_sent: true)
        end
      end