UNC-Libraries/hy-c

View on GitHub
app/services/hyrax/workflow/deletion_approval_notification.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true
module Hyrax
  module Workflow
    class DeletionApprovalNotification < AbstractNotification
      private

      def subject
        I18n.t('hyrax.notifications.workflow.deletion_approved.subject')
      end

      def message
        I18n.t('hyrax.notifications.workflow.deletion_approved.message', title: title, work_id: work_id,
                                                                         document_path: document_path, user: user, comment: comment)
      end

      def users_to_notify
        user_key = ActiveFedora::Base.find(work_id).depositor
        # Only returning the depositor, excluding the default users provided by parent class
        [::User.find_by(uid: user_key)]
      end
    end
  end
end