Class: SocialMailerController

Inherits:
ApplicationController show all
Includes:
ShareLayouts::Controllers::ActionController
Defined in:
app/controllers/social_mailer_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#cache, #pagination_parameters, #trusty_config

Instance Method Summary collapse

Methods inherited from ApplicationController

#initialize, #template_name

Methods included from LoginSystem

included

Constructor Details

This class inherits a constructor from ApplicationController

Instance Method Details

#create_social_mailObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/social_mailer_controller.rb', line 6

def create_social_mail

  mailer_options = {
    :to => params[:to],
    :from => params[:from],
    :from_name => params[:from_name],
    :message => params[:message],
    :subject => params[:subject]
  }

  if verify_recaptcha
    RadSocialMailer.social_mail(mailer_options).deliver_now
    head :ok
  else
    head :bad_request, :ErrorMsg => "Please verify that you are not a robot. Tick the reCAPTCHA checkbox."
  end

end

#social_mail_formObject



25
26
27
28
29
30
31
32
33
# File 'app/controllers/social_mailer_controller.rb', line 25

def social_mail_form
  render :template => "rad_social_mailer/social_mail_form",
         :layout => false,
         :locals => {
           :email_message => params[:email_message],
           :email_subject => params[:email_subject],
           :email_action_url => params[:email_action_url]
         }
end