Class: ExportEmailController
Instance Method Summary
collapse
set_default_configuration!
Instance Method Details
#email ⇒ Object
18
19
20
|
# File 'app/controllers/export_email_controller.rb', line 18
def email
end
|
#load_objects ⇒ Object
13
14
15
16
|
# File 'app/controllers/export_email_controller.rb', line 13
def load_objects
@svc_response = ServiceResponse.find(params[:id])
@user_request = @svc_response.request if @svc_response
end
|
#send_email ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/export_email_controller.rb', line 26
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
respond_to do |format|
format.html { render }
end
else
@partial = "email"
flash[:error] = email_validation_error
redirect_to params_preserve_xhr(params.merge(:action => "email"))
end
end
|
#send_txt ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'app/controllers/export_email_controller.rb', line 44
def send_txt
@number = params[:number]
@number.gsub!(/[^\d]/, '') if @number
@provider = params[:provider]
@email = "#{@number}@#{@provider}" unless @number.nil? or @provider.nil?
@holding_id = params[:holding]
if valid_txt_number? && valid_txt_holding?
Emailer.short_citation(@email, @user_request, location(@holding_id), call_number(@holding_id)).deliver
render else
flash[:error] = txt_validation_error
redirect_to params_preserve_xhr(params.merge(:action => "txt"))
end
end
|
#txt ⇒ Object
22
23
24
|
# File 'app/controllers/export_email_controller.rb', line 22
def txt
end
|