Sha256: e08377e1e80412929fc4fbc0061f0a37bd2cc033b2ee8a6a8864a670aec3a190

Contents?: true

Size: 733 Bytes

Versions: 5

Compression:

Stored size: 733 Bytes

Contents

# -*- encoding : utf-8 -*-
# overriding Blacklight RecordMailer to add :from address in email
# otherwise we get error: ArgumentError (An SMTP From address is required to send a message
class RecordMailer < ActionMailer::Base
  def email_record(documents, details, url_gen_params)

    subject = I18n.t('blacklight.email.text.subject', :count => documents.length, :title => (documents.first.to_semantic_values[:title] rescue 'N/A') )

    @documents      = documents
    @message        = details[:message]
    @url_gen_params = url_gen_params

    mail(:to => details[:to],
         :from => t('blacklight.email.record_mailer.name') + ' <' + t('blacklight.email.record_mailer.email') + '>',
         :subject => subject)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
commonwealth-vlr-engine-0.0.7 app/models/record_mailer.rb
commonwealth-vlr-engine-0.0.4 app/models/record_mailer.rb
commonwealth-vlr-engine-0.0.3 app/models/record_mailer.rb
commonwealth-vlr-engine-0.0.2 app/models/record_mailer.rb
commonwealth-vlr-engine-0.0.1 app/models/record_mailer.rb