Git Product home page Git Product logo

devise_campaignable's People

Contributors

adambedford avatar danblakeman avatar michaelti avatar pedantic-git avatar sirrawlins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

devise_campaignable's Issues

Vendor Name Default

Hey Guys -

Run into a problem with the :vendor_name default value. When I leave it set to the default value, I get this error:
NameError - uninitialized constant Devise::Models::Campaignable::Adapters::VendorName

When I change the default value to :mailchimp I get this error:
NameError - uninitialized constant Gibbon::API

I'm stuck at this point. I'm running Rails 4.2.4 and Ruby 2.2.1 and the latest version of Mailchimp.

Thanks!

Additional Fields not working

Im sending additional fields to Mailchimp but they are not being created.

Has Mailchimp's API change? Any suggestions on what to try?

config.campaignable_additional_fields

config.campaignable_additional_fields = [:email, :name, :stripe_subscription_id, :stripe_id, :created_at]

how to disable / mock on the test environment?

It would be worth thinking how this gem can be disabled / mocked on the test environment, so real calls to Mailchimp are not made when running the test suite of an app that uses it.

By now I've just skipped including the :campaignable module on the User on the test environment, like this, but this does not seem the cleanest solution:

class User < ActiveRecord::Base
  # Disable Campaignable on test environment
  if Rails.env.test?
    devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable,
           :validatable, :confirmable, :lockable, :timeoutable
  else
    devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable,
           :validatable, :confirmable, :lockable, :timeoutable, :campaignable
  end
end

Requires you to add Gibbon dependancy manually.

We recently merged in a PR #1 which added install instructions asking users to add 'Gibbon' to their Gemfile as it wasn't being installed by Bundler as part of the devise_campaignable dependancy tree.

The gemspec does list Gibbon as a runtime dependancy so I'm a little confused as to why Bundler isn't picking it up. I've also noticed that I myself haven't had this issue.

Need to find a way to reproduce the problem and we can then patch things up.

undefined method 'delay' for Devise::Models::Campaignable::Adapters::Mailchimp

Hi, I got this when trying the gem on a Rails 4.1.12 and Devise 3.4.1

NoMethodError - undefined method `delay' for #<Devise::Models::Campaignable::Adapters::Mailchimp:0x007fcfebf04958>:
  devise_campaignable (0.0.3) lib/devise_campaignable/model.rb:63:in `list_manager'
  devise_campaignable (0.0.3) lib/devise_campaignable/model.rb:33:in `subscribe'
  activesupport (4.1.12) lib/active_support/callbacks.rb:429:in `block in make_lambda'
  activesupport (4.1.12) lib/active_support/callbacks.rb:224:in `block in halting_and_conditional'
  activesupport (4.1.12) lib/active_support/callbacks.rb:503:in `block in call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:503:in `call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:86:in `run_callbacks'
  activerecord (4.1.12) lib/active_record/callbacks.rb:306:in `_create_record'
  activerecord (4.1.12) lib/active_record/timestamp.rb:57:in `_create_record'
  activerecord (4.1.12) lib/active_record/persistence.rb:484:in `create_or_update'
  activerecord (4.1.12) lib/active_record/callbacks.rb:302:in `block in create_or_update'
  activesupport (4.1.12) lib/active_support/callbacks.rb:113:in `call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:552:in `block (2 levels) in compile'
  activesupport (4.1.12) lib/active_support/callbacks.rb:502:in `call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:86:in `run_callbacks'
  activerecord (4.1.12) lib/active_record/callbacks.rb:302:in `create_or_update'
  activerecord (4.1.12) lib/active_record/persistence.rb:103:in `save'
  activerecord (4.1.12) lib/active_record/validations.rb:51:in `save'
  activerecord (4.1.12) lib/active_record/attribute_methods/dirty.rb:21:in `save'
  activerecord (4.1.12) lib/active_record/transactions.rb:268:in `block (2 levels) in save'
  activerecord (4.1.12) lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
  activerecord (4.1.12) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
  activerecord (4.1.12) lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
  activerecord (4.1.12) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
  activerecord (4.1.12) lib/active_record/transactions.rb:208:in `transaction'
  activerecord (4.1.12) lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
  activerecord (4.1.12) lib/active_record/transactions.rb:268:in `block in save'
  activerecord (4.1.12) lib/active_record/transactions.rb:283:in `rollback_active_record_state!'
  activerecord (4.1.12) lib/active_record/transactions.rb:267:in `save'
  devise (3.4.1) app/controllers/devise/registrations_controller.rb:19:in `create'
  actionpack (4.1.12) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.1.12) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.1.12) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.1.12) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.1.12) lib/active_support/callbacks.rb:113:in `call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:552:in `block (2 levels) in compile'
  activesupport (4.1.12) lib/active_support/callbacks.rb:502:in `call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.12) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.1.12) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.1.12) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.1.12) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.12) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.12) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.1.12) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.1.12) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.1.12) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.1.12) lib/abstract_controller/base.rb:136:in `process'
  actionview (4.1.12) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.1.12) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.1.12) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.1.12) lib/action_controller/metal.rb:232:in `block in action'
  actionpack (4.1.12) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
  actionpack (4.1.12) lib/action_dispatch/routing/route_set.rb:50:in `call'
  actionpack (4.1.12) lib/action_dispatch/routing/mapper.rb:45:in `call'
  actionpack (4.1.12) lib/action_dispatch/journey/router.rb:73:in `block in call'
  actionpack (4.1.12) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.1.12) lib/action_dispatch/routing/route_set.rb:692:in `call'
  meta_request (0.3.4) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
  meta_request (0.3.4) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
  bullet (4.14.0) lib/bullet/rack.rb:12:in `call'
  rack-attack (4.2.0) lib/rack/attack.rb:104:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.5) lib/rack/etag.rb:23:in `call'
  rack (1.5.5) lib/rack/conditionalget.rb:35:in `call'
  rack (1.5.5) lib/rack/head.rb:11:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/flash.rb:254:in `call'
  rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/cookies.rb:562:in `call'
  activerecord (4.1.12) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
  activerecord (4.1.12) lib/active_record/migration.rb:380:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.1.12) lib/active_support/callbacks.rb:82:in `run_callbacks'
  actionpack (4.1.12) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
  rack-contrib (1.2.0) lib/rack/contrib/response_headers.rb:17:in `call'
  meta_request (0.3.4) lib/meta_request/middlewares/headers.rb:16:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.12) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.12) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.12) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.12) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.12) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.12) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
  actionpack (4.1.12) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.5) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.12) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.5) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.12) lib/action_dispatch/middleware/static.rb:84:in `call'
  rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.12) lib/rails/engine.rb:514:in `call'
  railties (4.1.12) lib/rails/application.rb:144:in `call'
  rack (1.5.5) lib/rack/lock.rb:17:in `call'
  rack (1.5.5) lib/rack/content_length.rb:14:in `call'
  rack (1.5.5) lib/rack/handler/webrick.rb:60:in `service'
   () Users/jaime/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
   () Users/jaime/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
   () Users/jaime/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

Skip campaignable if API connection causes an error

After configuring devise_campaignable, when creating a new User, if there is any error with accessing the Mailchimp API (i.e. if we cannot connect to the API), then Rails throws a 500 Internal Server Error and fails to create the user.

Is there any way to just skip the Mailchimp subscription and continue creating the user if we fail to connect to Mailchimp? Our Rails app should still be functional if, for example, the Mailchimp server goes down.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.