【问题标题】:Gibbon Gem Mailchimp Form IssueGibbon Gem Mailchimp 表单问题
【发布时间】:2016-05-06 13:12:45
【问题描述】:

我不知道为什么,但电子邮件没有传递到我的 Mailchimp 列表。单击提交按钮不会执行任何操作。有什么想法吗?

宝石文件:

gem 'gibbon', '~> 1.0.0'

index.html.erb:

<%= form_tag('/welcome/subscribe', method: "post", id: "subscribe", remote: "true") do -%>
   <%= email_field(:email, :address, {id: "email", placeholder: "email address", :class=>"email form-control"}) %>
   <%= submit_tag("Sign me up!", :class=>"btn btn-palette") %>
<% end %>

models/welcome.rb:

def subscribe

@list_id = "my list id is in here"
gb = Gibbon::API.new

gb.lists.subscribe({
  double_opt_in: false,
  :id => @list_id,
  :email => {:email => params[:email][:address]}
  })
end

初始化程序/gibbon.rb:

Gibbon::API.api_key = "my api key is in here"
Gibbon::API.timeout = 15
Gibbon::API.throws_exceptions = false

routes.rb:

post 'welcome/subscribe' => 'welcome#subscribe'
  root 'welcome#index'

控制器/welcome_controller.rb:

class WelcomeController < ApplicationController
  def index
  end

  def subscribe

    @list_id = "my list id is in here"
    gb = Gibbon::API.new

    gb.lists.subscribe({
      double_opt_in: false,
      :id => @list_id,
      :email => {:email => params[:email][:address]}
      })
    end
  end

【问题讨论】:

    标签: ruby-on-rails ruby mailchimp gibbon


    【解决方案1】:

    在这里用这段代码解决了这个问题:Mailchimp gem double_optin false not working

    但有双重选择问题 => false

    【讨论】:

      猜你喜欢
      • 2013-02-20
      • 2013-09-07
      • 2016-01-21
      • 2015-01-22
      • 2013-11-19
      • 2015-11-24
      • 2016-05-26
      • 2013-06-26
      • 1970-01-01
      相关资源
      最近更新 更多