Sha256: 0e15bfb4651bc97bdc90691f466e8f9b12c563683698f7fc8a34f64c3dbd6d7f

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

# Caution: Not yet implemmented!
module AlchemyCrm
  class SubscriptionsController < AlchemyCrm::BaseController
    include I18nHelpers
    before_filter :load_contact, :except => :deliver_subscriptions_overview

    def index
      @page = Alchemy::Page.find_by_page_layout('newsletter_views')
      @root_page = @page.get_language_root
      render :template => 'alchemy/pages/show', :layout => layout_for_page
    end

    def new

    end

    def create
      
    end

    def edit

    end

    def update
      
    end

    def destroy
      @subscription = @contact.subscriptions.find(params[:subscription_id])
      @subscription.destroy
      flash[:notice] = alchemy_crm_t(:subscription_destroyed)
      @page = Alchemy::Page.find_by_page_layout('newsletter_views')
      @root_page = @page.get_language_root
      render :template => 'alchemy/pages/show', :layout => layout_for_page
    end

    def overview
      @contact = Contact.find_by_email(params[:email])
      if @contact
        SubscriptionsMailer.overview_mail.deliver(@contact, @element)
        flash[:notice] = alchemy_crm_t(:send_subscriptions_overview_via_email)
        redirect_to :index
      else
        flash[:error] = alchemy_crm_t(:no_subscriber_found)
        render :index
      end
    end
    
  private

    def load_contact
      @contact = Contact.find_by_email_sha1(params[:token])
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alchemy_crm-2.0.5 app/controllers/alchemy_crm/subscriptions_controller.rb
alchemy_crm-2.0.4.1 app/controllers/alchemy_crm/subscriptions_controller.rb
alchemy_crm-2.1.0a app/controllers/alchemy_crm/subscriptions_controller.rb
alchemy_crm-2.0.3 app/controllers/alchemy_crm/subscriptions_controller.rb
alchemy_crm-2.0.2 app/controllers/alchemy_crm/subscriptions_controller.rb