Gibbon / Mailchimp注册表

时间:2015-06-27 13:14:59

标签: ruby-on-rails api email mailchimp gibbon

在为mailchimp列表创建简单的注册表单时遇到一些麻烦。无法弄清楚为什么当他们的电子邮件通过时,它不会传递给mailchimp ..想法?我确定我错过了这一步。

index.html.erb(表格)

public class MainActivity extends Activity implements OnClickListener {

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        function101();
        function103(String ef);  // this 2 function should execute in parallel

    }

    private void function101(){
        // some code
    }

    private void function102(String ab, int cd){

        function101();

        function103( String ef);   // i want this 2 function should execute in parallel

    }

    private void function103(String ef){
        // some code
    }

    private void function104(){

        function101();
        function102(String ab, int cd);
        function103(String ef);
    }

}

Gibbon.rb(初始化程序)

<%= form_tag('/welcome/subscribe', method: "post", id: "subscribe",) do -%>
<%= email_field(:email, :address, {id: "email", placeholder: "email address"}) %>
<%= submit_tag("Join!") %>
<% end %>

Welcome.rb(Model)

Gibbon::API.api_key = "Secret API Key"
Gibbon::API.timeout = 15
Gibbon::API.throws_exceptions = false

的routes.rb

def subscribe

@list_id = "Secret List ID"
gb = Gibbon::API.new

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

1 个答案:

答案 0 :(得分:3)

用户可能被添加为待处理,要求他们选择加入以完全订阅。您希望将double_opt_in: false参数传递给您的订阅。