Sha256: e66a154c7738e72b2624342cf5cb5467866e5c646f9fdefe91ddff49399eb0ba

Contents?: true

Size: 1.26 KB

Versions: 59

Compression:

Stored size: 1.26 KB

Contents

class Emailer < ActionMailer::Base
  include UmlautConfigurable
    
  self.umlaut_config = UmlautController.umlaut_config
  
  helper :application

  
  def citation(recipient, user_request, fulltexts, holdings)
    @title  = find_good_title(user_request.referent)
    @fulltexts  = fulltexts
    @holdings  = holdings
    @user_request = user_request
    
    mail(:to => recipient, 
         :from => umlaut_config.from_email_addr, 
         :'Reply-to' => umlaut_config.from_email_addr,
         :subject => "#{umlaut_config.app_name} result: #{find_good_title(user_request.referent)}")
  end
  
  def short_citation(recipient, user_request, location, call_number)
    
 
    @title  = find_good_title(user_request.referent)
    @location  = location
    @call_number  = call_number
    @user_request = user_request
    
    mail(:to => recipient, 
         :from => umlaut_config.from_email_addr,
         :'Reply-to' => umlaut_config.from_email_addr, 
         :subject => "#{umlaut_config.app_name} result")

  end

  protected
    def find_good_title(referent)
      citation = referent.to_citation
      if citation[:container_title]
        return citation[:container_title]
      else
        return "#{citation[:title]} / #{citation[:author]}" 
      end      
    end


  
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
umlaut-4.1.7 app/mailers/emailer.rb
umlaut-4.1.6 app/mailers/emailer.rb
umlaut-4.1.5 app/mailers/emailer.rb
umlaut-4.1.4 app/mailers/emailer.rb
umlaut-4.1.3 app/mailers/emailer.rb
umlaut-4.1.2 app/mailers/emailer.rb
umlaut-4.1.1 app/mailers/emailer.rb
umlaut-4.1.0 app/mailers/emailer.rb
umlaut-4.1.0.pre3 app/mailers/emailer.rb
umlaut-4.1.0.pre.2 app/mailers/emailer.rb
umlaut-4.1.0.pre.alpha.1 app/mailers/emailer.rb
umlaut-4.0.3 app/mailers/emailer.rb
umlaut-4.0.2 app/mailers/emailer.rb
umlaut-4.0.1 app/mailers/emailer.rb
umlaut-4.0.0 app/mailers/emailer.rb
umlaut-4.0.0.beta5 app/mailers/emailer.rb
umlaut-4.0.0.beta4 app/mailers/emailer.rb
umlaut-4.0.0.beta3 app/mailers/emailer.rb
umlaut-4.0.0.beta2 app/mailers/emailer.rb
umlaut-4.0.0.beta1 app/mailers/emailer.rb