11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/inquiries/inquiries_controller.rb', line 11
def create
@inquiry = Inquiries::Inquiry.new(params[:inquiries_inquiry])
if @inquiry.save
if @inquiry.ham?
begin
Inquiries::InquiryMailer.notification(@inquiry, request).deliver
rescue
logger.warn "There was an error delivering an inquiry notification.\n#{$!}\n"
end
begin
Inquiries::InquiryMailer.confirmation(@inquiry, request).deliver
rescue
logger.warn "There was an error delivering an inquiry confirmation:\n#{$!}\n"
end if Inquiries::Inquiry.send_confirmation?
end
redirect_to thank_you_inquiries_inquiries_path
else
render :action => 'new'
end
end
|