Sha256: 31f725e58adfc50f55fb677e31bd981f454d844c40104298056b9bdc290da6a3

Contents?: true

Size: 820 Bytes

Versions: 37

Compression:

Stored size: 820 Bytes

Contents

# frozen_string_literal: true
# This module provides the body of an email export based on the document's semantic values
module Blacklight::Document::Email
  # Return a text string that will be the body of the email
  def to_email_text
    semantics = to_semantic_values
    body = []
    body << I18n.t('blacklight.email.text.title', value: semantics[:title].join(" ")) if semantics[:title].present?
    body << I18n.t('blacklight.email.text.author', value: semantics[:author].join(" ")) if semantics[:author].present?
    body << I18n.t('blacklight.email.text.format', value: semantics[:format].join(" ")) if semantics[:format].present?
    body << I18n.t('blacklight.email.text.language', value: semantics[:language].join(" ")) if semantics[:language].present?
    return body.join("\n") unless body.empty?
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
blacklight-7.20.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.20.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.19.2 app/models/concerns/blacklight/document/email.rb
blacklight-7.19.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.19.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.18.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.18.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.17.2 app/models/concerns/blacklight/document/email.rb
blacklight-7.17.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.17.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.16.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.15.2 app/models/concerns/blacklight/document/email.rb
blacklight-7.15.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.15.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.14.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.14.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.13.2 app/models/concerns/blacklight/document/email.rb
blacklight-7.13.1 app/models/concerns/blacklight/document/email.rb
blacklight-7.13.0 app/models/concerns/blacklight/document/email.rb
blacklight-7.12.1 app/models/concerns/blacklight/document/email.rb