Dar*_*isa 3 ruby-on-rails gibbon
I am using the gibbon gem to connect to MailChimp. I am trying to retrieve a user from my list using their email address. According to: https://github.com/amro/gibbon the way to do this is the following:
gibbon.lists(list_id).members(lower_case_md5_hashed_email_address).retrieve
Run Code Online (Sandbox Code Playgroud)
I can get everything to work e.g. adding a new user
gibbon.lists(list_id).members
.create(body: {email_address: "#{email}", status: 'subscribed'} )
Run Code Online (Sandbox Code Playgroud)
This works fine, but if I try to retrieve one record I get an error: Gibbon::MailChimpError: bad URI
I am 95% sure it's because I am not submitting the email as a lower_case_md5_hashed_email_address
Right now I am submitting the request as follows:
gibbon.lists(list_id).members({email: email})
.update(body: {status: 'unsubscribed'} )
Run Code Online (Sandbox Code Playgroud)
What exactly is the lower_case_md5_hashed_email_address format?
请尝试按照以下代码生成 lower_case_md5_hashed_email_address
require 'digest'
lower_case_md5_hashed_email_address = Digest::MD5.hexdigest('YourMail@example.com'.downcase)
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请检查参考链接
| 归档时间: |
|
| 查看次数: |
389 次 |
| 最近记录: |