13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/contacts_controller.rb', line 13
def create
@conversation = Conversation.create(:status => "open", :topic_id => params[:conversation][:topic])
params[:contact][:conversation_id] = @conversation
@contact = @conversation.contacts.build(params[:contact] || {})
respond_to do |format|
if verify_recaptcha(@contact) && @contact.valid? && @contact.save
ContactMailer.message_email(@contact).deliver
ContactMailer.message_received_email(@contact).deliver
format.html { redirect_to(root_path, :notice => t("message_sent")) }
else
format.html { render :action => "new" }
end
end
end
|