Class: ExportEmailController

Inherits:
UmlautController show all
Defined in:
app/controllers/export_email_controller.rb

Instance Method Summary collapse

Methods included from Umlaut::ControllerBehavior

#default_url_options, #set_locale

Methods included from UmlautConfigurable

set_default_configuration!

Instance Method Details

#emailObject



6
7
# File 'app/controllers/export_email_controller.rb', line 6

def email
end

#send_emailObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/export_email_controller.rb', line 9

def send_email
  @email = params[:email]
  @fulltexts = @user_request.get_service_type('fulltext', { :refresh=>true })
  @holdings = @user_request.get_service_type('holding', { :refresh=>true })
  if valid_email?
    Emailer.citation(@email, @user_request, @fulltexts, @holdings).deliver
  else
    flash[:alert] = email_validation_error
    render :email and return
  end
end

#send_txtObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/export_email_controller.rb', line 24

def send_txt
  @number = params[:number]
  # Remove any punctuation or spaces etc
  @number.gsub!(/[^\d]/, '') if @number
  @provider = params[:provider]
  @email = "#{@number}@#{@provider}" unless @number.nil? or @provider.nil?
  @holding = params[:holding]
  if valid_txt_number? && valid_txt_holding?
    Emailer.short_citation(@email, @user_request, holding_location(@holding), call_number(@holding)).deliver
  else
    flash[:alert] = txt_validation_error
    render :txt and return
  end
end

#txtObject



21
22
# File 'app/controllers/export_email_controller.rb', line 21

def txt
end