Sha256: a46a77374a4c2ca805641e8f98b9b0b5b7c3833c9c7278b9c63338e97b182e1a

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

# encoding: UTF-8
module AlchemyCrm
  module Admin
    class MailingsController < AlchemyCrm::Admin::BaseController

      before_filter :load_newsletters, :only => [:new, :edit, :copy]

      helper 'AlchemyCrm::Mailings'
      helper 'Alchemy::Admin::Pages'

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

      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

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

      def update
        @mailing.update_attributes(params[:mailing])
        render_errors_or_redirect(
          @mailing,
          :back,
          flash_notice_for_resource_action
        )
      end

    private

      def load_newsletters
        @newsletters = Newsletter.all
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alchemy_crm-2.1.0a app/controllers/alchemy_crm/admin/mailings_controller.rb