Sha256: 27e4ded905405ca53196799b93fd9a748775ede7a1e3df6884e52fc80acf8ce5

Contents?: true

Size: 561 Bytes

Versions: 28

Compression:

Stored size: 561 Bytes

Contents

module Workarea
  class Storefront::EmailSignupsController < Storefront::ApplicationController
    def show
      @content = Storefront::EmailSignupsViewModel.new
    end

    def create
      signup = Email.signup(params[:email])

      if signup.try(:valid?)
        update_tracking!(email: signup.email)
        flash[:success] = t('workarea.storefront.flash_messages.email_signed_up')
      else
        flash[:error] = t('workarea.storefront.flash_messages.email_signup_error')
      end

      redirect_back fallback_location: root_path
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-storefront-3.5.6 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.5 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.4 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.3 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.2 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.1 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.0 app/controllers/workarea/storefront/email_signups_controller.rb
workarea-storefront-3.5.0.beta.1 app/controllers/workarea/storefront/email_signups_controller.rb