Class: Admin::CampaignsController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::CampaignsController
- Defined in:
- app/controllers/admin/campaigns_controller.rb
Instance Method Summary collapse
- #new ⇒ Object
- #schedule ⇒ Object
- #send_now ⇒ Object
- #send_options ⇒ Object
- #send_test ⇒ Object
- #unschedule ⇒ Object
Instance Method Details
#new ⇒ Object
12 13 14 15 16 |
# File 'app/controllers/admin/campaigns_controller.rb', line 12 def new @campaign = Campaign.new :to_name => RefinerySetting.get_or_set(Refinery::Mailchimp::API::DefaultToNameSetting[:name], Refinery::Mailchimp::API::DefaultToNameSetting[:default]), :from_name => RefinerySetting.get_or_set(Refinery::Mailchimp::API::DefaultFromNameSetting[:name], Refinery::Mailchimp::API::DefaultFromNameSetting[:default]), :from_email => RefinerySetting.get_or_set(Refinery::Mailchimp::API::DefaultFromEmailSetting[:name], Refinery::Mailchimp::API::DefaultFromEmailSetting[:default]) end |
#schedule ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'app/controllers/admin/campaigns_controller.rb', line 39 def schedule if @campaign.schedule_for DateTime.new(*params['date'].values_at('year','month','day','hour','minute').map{|x|x.to_i}) flash[:notice] = t('admin.campaigns.campaign.schedule_success') else flash[:alert] = t('admin.campaigns.campaign.schedule_failure') end sending_redirect_to admin_campaigns_path end |
#send_now ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/controllers/admin/campaigns_controller.rb', line 30 def send_now if @campaign.send_now flash[:notice] = t('admin.campaigns.campaign.send_now_success') else flash[:alert] = t('admin.campaigns.campaign.send_now_failure') end sending_redirect_to admin_campaigns_path end |
#send_options ⇒ Object
18 19 |
# File 'app/controllers/admin/campaigns_controller.rb', line 18 def end |
#send_test ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/controllers/admin/campaigns_controller.rb', line 21 def send_test if @campaign.send_test_to params[:email] flash[:notice] = t('admin.campaigns.campaign.send_test_success', :email => params[:email]) else flash[:alert] = t('admin.campaigns.campaign.send_test_failure', :email => params[:email]) end sending_redirect_to admin_campaigns_path end |
#unschedule ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'app/controllers/admin/campaigns_controller.rb', line 48 def unschedule if @campaign.unschedule flash[:notice] = t('admin.campaigns.campaign.unschedule_success') else flash[:alert] = t('admin.campaigns.campaign.unschedule_failure') end sending_redirect_to admin_campaigns_path end |