MailChimp表单未将用户注册为待处理状态,直到他们通过电子邮件确认

时间:2015-09-04 21:29:21

标签: ruby-on-rails mailchimp gibbon

我正在尝试将我的应用用户列表与在MailChimp上订阅的用户同步。

我们正在使用带有Rails 4的Gibbon gem。一切正常,我可以根据用户的电子邮件地址查看用户的状态,并确定他们是订阅,待处理还是无。用户可以通过指向MailChimp在线表单的链接进行注册,也可以通过选中我们的网络应用程序中的选择框进行注册。

问题是,如果用户通过MailChimp链接进行订阅,则MailChimp API不会将其识别为待处理。因此,我们的应用程序收到的是nil,而不是" pending"如果他们通过复选框注册,会发生什么。

由于应用收到回复nil,它会向用户表明他们应该选中该框以注册awk的简报,因为他们已经注册了一次。

除此之外,如果用户选中已经直接使用MailChimp注册的方框,则由于MailChimp已经拥有该电子邮件地址,因此会被400错误拒绝。

我的目标是在MailChimp上订阅,待定等用户时能够在应用中准确反映。

错误和完整跟踪如下:

  

.bundle / gems / ruby​​ / 2.2.0 / gems / gibbon-2.0.0 / lib / gibbon / api_request.rb:100:handle_error' .bundle/gems/ruby/2.2.0/gems/gibbon-2.0.0/lib/gibbon/api_request.rb:16:in在帖子中拯救'   .bundle / gems / ruby​​ / 2.2.0 / gems / gibbon-2.0.0 / lib / gibbon / api_request.rb:10:in post' .bundle/gems/ruby/2.2.0/gems/gibbon-2.0.0/lib/gibbon/request.rb:28:in create'   app / models / user.rb:60:在make_lambda中的add_to_mailchimp' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:430:in块中'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:237:在call' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:237:in块停止'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:504:在call' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:504:in阻止通话中'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:504:in each' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:504:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:88:in run_callbacks' .bundle/gems/ruby/2.2.0/gems/activemodel-4.2.3/lib/active_model/validations/callbacks.rb:113:in run_validations!'   .bundle / gems / ruby​​ / 2.2.0 / gems / activemodel-4.2.3 / lib / active_model / validations.rb:334:valid?' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/validations.rb:58:in有效吗?'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / validations.rb:83:in perform_validations' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/validations.rb:37:in save'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / attribute_methods / dirty.rb:21:在save' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:286:in块(2级)中保存'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / transactions.rb:351:在block in with_transaction_returning_status' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in交易'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / transactions.rb:220:in transaction' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:348:in with_transaction_returning_status'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / transactions.rb:286:in block in save' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:301:in rollback_active_record_state!'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / transactions.rb:285:in save' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/persistence.rb:252:in阻止更新'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / transactions.rb:351:在事务中的block in with_transaction_returning_status' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in块中'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / connection_adapters / abstract / transaction.rb:184:in within_new_transaction' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in transaction'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / transactions.rb:220:in transaction' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:348:in with_transaction_returning_status'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / persistence.rb:250:update' app/controllers/users_controller.rb:20:in更新'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_controller / metal / implicit_render.rb:4:在send_action' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/base.rb:198:in process_action'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_controller / metal / rendering.rb:10:在process_action&{39;中的process_action' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/callbacks.rb:20:in块中   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:115:在call' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:553:在block (2 levels) in compile' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:503:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:503:在call' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:88:in run_callbacks'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / abstract_controller / callbacks.rb:19:in process_action' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/rescue.rb:29:in process_action'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_controller / metal / instrumentation.rb:32:在block in process_action' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/notifications.rb:164:in块中的仪器'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / notifications / instrumenter.rb:20:in instrument' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/notifications.rb:164:in instrument'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_controller / metal / instrumentation.rb:30:在process_action' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/params_wrapper.rb:250:in process_action'   .bundle / gems / ruby​​ / 2.2.0 / gems / searchkick-0.8.7 / lib / searchkick / logging.rb:107:在process_action' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/railties/controller_runtime.rb:18:in process_action'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / abstract_controller / base.rb:137:在process' .bundle/gems/ruby/2.2.0/gems/actionview-4.2.3/lib/action_view/rendering.rb:30:in进程'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_controller / metal.rb:196:在dispatch' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/rack_delegation.rb:13:in发送'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_controller / metal.rb:237:block in action' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:76:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / routing / route_set.rb:76:in dispatch' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:45:in发送'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / journey / router.rb:43:block in serve' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in每个'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / journey / router.rb:30:serve' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:821:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / rack-pjax-0.8.0 / lib / rack / pjax.rb:12:in call' .bundle/gems/ruby/2.2.0/gems/bullet-4.14.7/lib/bullet/rack.rb:12:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / warden-1.2.3 / lib / warden / manager.rb:35:in block in call' .bundle/gems/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in catch'   .bundle / gems / ruby​​ / 2.2.0 / gems / warden-1.2.3 / lib / warden / manager.rb:34:in call' .bundle/gems/ruby/2.2.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / conditionalget.rb:38:in call' .bundle/gems/ruby/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / remotipart-1.2.1 / lib / remotipart / middleware.rb:27:in call' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/params_parser.rb:27:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / middleware / flash.rb:260:call' .bundle/gems/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in上下文'   .bundle / gems / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / session / abstract / id.rb:220:in call' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/cookies.rb:560:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / query_cache.rb:36:in call' .bundle/gems/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in call'   .bundle / gems / ruby​​ / 2.2.0 / gems / activerecord-4.2.3 / lib / active_record / migration.rb:377:call' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/callbacks.rb:29:in阻止通话'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / callbacks.rb:84:in run_callbacks' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/callbacks.rb:27:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / middleware / reloader.rb:73:in call' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/remote_ip.rb:78:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / rollbar-1.5.3 / lib / rollbar / middleware / rails / rollbar.rb:24:in block in call' .bundle/gems/ruby/2.2.0/gems/rollbar-1.5.3/lib/rollbar.rb:799:in scoped'   .bundle / gems / ruby​​ / 2.2.0 / gems / rollbar-1.5.3 / lib / rollbar / middleware / rails / rollbar.rb:22:in call' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:17:in call'   .bundle / gems / ruby​​ / 2.2.0 / gems / rollbar-1.5.3 / lib / rollbar / middleware / rails / show_exceptions.rb:22:in call_with_rollbar' .bundle/gems/ruby/2.2.0/gems/web-console-2.1.2/lib/web_console/middleware.rb:37:in call'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / middleware / show_exceptions.rb:30:in call' .bundle/gems/ruby/2.2.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:38:in call_app'   .bundle / gems / ruby​​ / 2.2.0 / gems / railties-4.2.3 / lib / rails / rack / logger.rb:20:block in call' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:68:in块中标记的'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / tagged_logging.rb:26:in tagged' .bundle/gems/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:68:in已标记'   .bundle / gems / ruby​​ / 2.2.0 / gems / railties-4.2.3 / lib / rails / rack / logger.rb:20:in call' .bundle/gems/ruby/2.2.0/gems/ahoy_matey-1.1.1/lib/ahoy/engine.rb:20:in call_with_quiet_ahoy'   .bundle / gems / ruby​​ / 2.2.0 / gems / request_store-1.1.0 / lib / request_store / middleware.rb:8:in call' .bundle/gems/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/request_id.rb:21:in call'   .bundle / gems / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / methodoverride.rb:22:in call' .bundle/gems/ruby/2.2.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / activesupport-4.2.3 / lib / active_support / cache / strategy / local_cache_middleware.rb:28:in call' .bundle/gems/ruby/2.2.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in call'   .bundle / gems / ruby​​ / 2.2.0 / gems / actionpack-4.2.3 / lib / action_dispatch / middleware / static.rb:116:in call' .bundle/gems/ruby/2.2.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in call'   .bundle / gems / ruby​​ / 2.2.0 / gems / railties-4.2.3 / lib / rails / engine.rb:518:call' .bundle/gems/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application.rb:165:in来电'   .bundle / gems / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / content_length.rb:15:in call' .bundle/gems/ruby/2.2.0/gems/puma-2.11.2/lib/puma/server.rb:507:in handle_request'   .bundle / gems / ruby​​ / 2.2.0 / gems / puma-2.11.2 / lib / puma / server.rb:375:在process_client' .bundle/gems/ruby/2.2.0/gems/puma-2.11.2/lib/puma/server.rb:262:in块中运行'   .bundle / gems / ruby​​ / 2.2.0 / gems / puma-2.11.2 / lib / puma / thread_pool.rb:104:在spawn_thread的call' .bundle/gems/ruby/2.2.0/gems/puma-2.11.2/lib/puma/thread_pool.rb:104:in块中'

0 个答案:

没有答案