diff --git a/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb b/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb index 84329057d0..890ca01694 100644 --- a/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb +++ b/app/models/policies/further_education_payments/admin_provider_verification_task_presenter.rb @@ -25,8 +25,8 @@ def rows end end - def latest_admin_sent_email - claim.notes.by_label("provider_verification").order(created_at: :desc).first + def admin_sent_emails + @admin_sent_emails ||= claim.notes.by_label("provider_verification").order(created_at: :desc) end def verification_email_sent? @@ -34,7 +34,7 @@ def verification_email_sent? end def verification_email_sent_by_admin_team? - latest_admin_sent_email.present? + admin_sent_emails.any? end private diff --git a/app/views/admin/tasks/_provider_verification_unsubmitted.html.erb b/app/views/admin/tasks/_provider_verification_unsubmitted.html.erb index 42861d50d4..adb49e9a92 100644 --- a/app/views/admin/tasks/_provider_verification_unsubmitted.html.erb +++ b/app/views/admin/tasks/_provider_verification_unsubmitted.html.erb @@ -1,11 +1,12 @@ <% if @tasks_presenter.provider_verification.verification_email_sent? %> <% if @tasks_presenter.provider_verification.verification_email_sent_by_admin_team? %> - <% verification_email = @tasks_presenter.provider_verification.latest_admin_sent_email %>
- The verification request was sent to the provider by - <%= user_details(verification_email.created_by) %> on <%= l(verification_email.created_at) %> -
+ <% @tasks_presenter.provider_verification.admin_sent_emails.each do |verification_email| %> ++ The verification request was sent to the provider by + <%= user_details(verification_email.created_by) %> on <%= l(verification_email.created_at) %> +
+ <% end %>