Sha256: 603f4a51d675b5151d9702a3ea49970fa0897933836f21d6ea6b4db9788d272a

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

module Workarea
  decorate Storefront::EmailSignupsController, with: :emarsys do
    def create
      signup = Email.signup(params[:email])

      if signup.try(:valid?)
        update_tracking!(email: signup.email)
        cookies[:emarsys_email] = params[: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

3 entries across 3 versions & 1 rubygems

Version Path
workarea-emarsys-2.0.1 app/controllers/workarea/storefront/email_signups_controller.decorator
workarea-emarsys-2.0.0 app/controllers/workarea/storefront/email_signups_controller.decorator
workarea-emarsys-1.1.0 app/controllers/workarea/storefront/email_signups_controller.decorator