15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/refinery/inquiries/inquiries_controller.rb', line 15
def create
@inquiry = Inquiry.new(inquiry_params)
if @inquiry.save
if @inquiry.ham? || Inquiries.send_notifications_for_inquiries_marked_as_spam
begin
InquiryMailer.notification(@inquiry, request).deliver_now
rescue
logger.warn "There was an error delivering an inquiry notification.\n#{$!}\n"
end
if Setting.send_confirmation?
begin
InquiryMailer.confirmation(@inquiry, request).deliver_now
rescue
logger.warn "There was an error delivering an inquiry confirmation:\n#{$!}\n"
end
end
end
redirect_to refinery.thank_you_inquiries_inquiries_path
else
render action: 'new'
end
end
|