Sha256: b2dd41ffe1957e247466ba16465a3952f2820e90b8cf826c766e6816e62b91e8

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

# Only works for documents with a #to_marc right now.
class RecordMailer < ApplicationMailer
  helper CatalogHelper
  helper_method :blacklight_config, :blacklight_configuration_context

  def email_record(documents, details, url_gen_params)
    @documents      = documents
    @message        = details[:message]
    @config         = details[:config]
    @url_gen_params = url_gen_params

    title = view_context.document_presenter(documents.first).html_title || I18n.t('blacklight.email.text.default_title')

    subject = I18n.t('blacklight.email.text.subject',
                     count: documents.length,
                     title: Array(title).first)

    mail(to: details[:to], subject: subject)
  end

  def sms_record(documents, details, url_gen_params)
    @documents      = documents
    @config         = details[:config]
    @url_gen_params = url_gen_params

    mail(to: details[:to], subject: "") # rubocop:disable Rails/I18nLocaleTexts
  end

  def blacklight_config
    @config || Blacklight.default_configuration
  end

  ##
  # Context in which to evaluate blacklight configuration conditionals
  def blacklight_configuration_context
    @blacklight_configuration_context ||= Blacklight::Configuration::Context.new(self)
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/models/record_mailer.rb
blacklight-8.6.0 app/models/record_mailer.rb
blacklight-8.5.1 app/models/record_mailer.rb
blacklight-8.5.0 app/models/record_mailer.rb
blacklight-8.4.0 app/models/record_mailer.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/models/record_mailer.rb
blacklight-8.3.0 app/models/record_mailer.rb
blacklight-8.2.2 app/models/record_mailer.rb
blacklight-8.2.1 app/models/record_mailer.rb
blacklight-8.2.0 app/models/record_mailer.rb
blacklight-8.1.0 app/models/record_mailer.rb
blacklight-8.0.1 app/models/record_mailer.rb
blacklight-8.0.0 app/models/record_mailer.rb
blacklight-8.0.0.beta8 app/models/record_mailer.rb
blacklight-8.0.0.beta7 app/models/record_mailer.rb
blacklight-8.0.0.beta6 app/models/record_mailer.rb
blacklight-8.0.0.beta5 app/models/record_mailer.rb