app/models/services/ivl_enrollment_service.rb
# Triggers ENR or DR notice based on the application setting
Triggers ENR or DR notice based on the application setting
Triggers ENR or DR notice based on the application setting
def send_enr_or_dr_notice_to_ivl(new_date)
      @logger.info '*' * 50
      @logger.info "Started send_enr_or_dr_notice_for_ivl process at #{TimeKeeper.datetime_of_record}"
      families = enrollment_notice_for_ivl_families(new_date)
      families.each do |family|
        begin
          person = family.primary_applicant.person
          if EnrollRegistry[:legacy_enrollment_trigger].enabled?
            IvlNoticesNotifierJob.perform_later(person.id.to_s, "enrollment_notice") if person.consumer_role.present?
          elsif EnrollRegistry[:document_reminder_notice_trigger].enabled?
            result = ::Operations::Notices::IvlDocumentReminderNotice.new.call(family: family)
            reminder_notice_logger(result, person, 'verifications_reminder')
          end
        rescue Exception => e
          Rails.logger.error { "Unable to deliver enrollment notice #{person.hbx_id} due to #{e.inspect}" }
        end
      end
      @logger.info "Ended send_enr_or_dr_notice_for_ivl process at #{TimeKeeper.datetime_of_record}"
      families
    end
def send_enr_or_dr_notice_to_ivl ( new_date ) @logger . info '*' * 50 @logger . info "Started send_enr_or_dr_notice_for_ivl process at #{TimeKeeper.datetime_of_record}" families = enrollment_notice_for_ivl_families ( new_date ) families . each do | family | begin person = family . primary_applicant . person if EnrollRegistry [ :legacy_enrollment_trigger ] . enabled? IvlNoticesNotifierJob . perform_later ( person . id . to_s , "enrollment_notice" ) if person . consumer_role . present? elsif EnrollRegistry [ :document_reminder_notice_trigger ] . enabled? result = :: Operations :: Notices :: IvlDocumentReminderNotice . new . call ( family : family ) reminder_notice_logger ( result , person , 'verifications_reminder' ) end rescue Exception => e Rails . logger . error { "Unable to deliver enrollment notice #{person.hbx_id} due to #{e.inspect}" } end end @logger . info "Ended send_enr_or_dr_notice_for_ivl process at #{TimeKeeper.datetime_of_record}" families end
Triggers ENR or DR notice based on the application setting
Triggers ENR or DR notice based on the application setting
new_date