Class: AlchemyCrm::Admin::MailingsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/alchemy_crm/admin/mailings_controller.rb

Instance Method Summary collapse

Methods included from I18nHelpers

#alchemy_crm_t, #i18n_t, included, #translate_model_attribute

Instance Method Details

#copyObject



11
12
13
14
# File 'app/controllers/alchemy_crm/admin/mailings_controller.rb', line 11

def copy
  @mailing = Mailing.copy(params[:id])
  render :action => :new, :layout => false
end

#edit_contentObject



25
26
27
28
# File 'app/controllers/alchemy_crm/admin/mailings_controller.rb', line 25

def edit_content
  @mailing = Mailing.find(params[:id])
  @page = @mailing.page
end

#showObject



16
17
18
19
20
21
22
23
# File 'app/controllers/alchemy_crm/admin/mailings_controller.rb', line 16

def show
  @mailing = Mailing.find(params[:id])
  @page = @mailing.page
  @contact = Contact.fake
  @recipient = Recipient.new_from_contact(@contact)
  @preview_mode = true
  render :layout => 'alchemy_crm/mailings'
end

#updateObject



30
31
32
33
34
35
36
37
# File 'app/controllers/alchemy_crm/admin/mailings_controller.rb', line 30

def update
  @mailing.update_attributes(params[:mailing], :as => current_user.role.to_sym)
  render_errors_or_redirect(
    @mailing,
    :back,
    flash_notice_for_resource_action
  )
end