5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/refinery/contacts/mail_messages_controller.rb', line 5
def deliver
@mail_message = MailMessage.new(params[:mail_message])
if @mail_message.valid? && verify_recaptcha(:model => @mail_message)
mail = Refinery::Contacts::Mail.select("mail").find(@mail_message.recipient_id)
@mail_message.recipient_mail = mail[:mail].to_s
ContactMailer.contact_form(@mail_message).deliver
flash[:notice] = t('refinery.contacts.contacts.flash.successfull_delivery')
else
flash[:mail_message] = @mail_message end
redirect_to :back
end
|