Mailchimp API for Rails - list.subscribe(:double_optin => false) 不工作 [英] Mailchimp API for Rails - list.subscribe(:double_optin => false) not working

查看:30
本文介绍了Mailchimp API for Rails - list.subscribe(:double_optin => false) 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 mailchimp-api gem,可以通过提交电子邮件并将确认电子邮件发送到已注册的电子邮件来使提交的电子邮件生效,但我想禁用 double_optin 标志.我正在尝试这样做:

I am using the mailchimp-api gem and can get the submitted email to work by submitting an email and having a confirmation email sent to that email that signed up but I want to disable the double_optin flag. I am trying to do it with:

@mc = Mailchimp::API.new('my api key here')
@mc.list.subscribe('list_id', {'email' => params[:email]}, :double_optin => false)

这仍在向该电子邮件地址发送确认电子邮件.

This is still sending a confirmation email to that email address.

我真的不喜欢它重定向到 mailchimp 页面以让您确认订阅并必须单击另一个按钮才能重定向到该站点的方式.如果您可以自定义确认电子邮件,那将是一回事,但拥有这个通用确认页面很糟糕.

I really don't like how it redirects to a mailchimp page to have you confirm your subscription and have to click another button to be redirected to the site. If you could customize the confirmation email that would be one thing but having this generic confirmation page is terrible.

我想知道您是否必须拥有付费帐户才能切换 :double_optin 标志?

I am wondering if you have to have a paid account to be able to toggle the :double_optin flag?

推荐答案

最终得到了以下解决方案:

Ended up getting this to work with the following:

@mc = Mailchimp::API.new('my api key here')
@mc.list.subscribe({:id => 'list_id', :email => {:email => params[:email]}, :double_optin => false})

注意这里的区别在于 @mc.list.subscribe 中的每个参数都在一个散列中.

Note the difference here is that every parameter in @mc.list.subscribe is in a hash.

这篇关于Mailchimp API for Rails - list.subscribe(:double_optin => false) 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆