获取rails中的邮件黑猩猩订阅者列表

时间:2014-04-10 23:20:08

标签: ruby-on-rails-4 ruby-on-rails-3.2 mailchimp

我正在开发一个简单的rails rails应用程序,我在我的邮件mailchimp帐户中有这么多订阅者,我希望得到我的所有订阅者并从我的rails应用程序发送邮件。如何让我的订阅者以数组形式发送电子邮件。

我的代码示例位于

之下
def send_now
    @news_letter = NewsLetter.find(params[:id])  
      gb = Gibbon::API.new("xxx")
      members = gb.lists.members({:id => 'xxx'})
      #for each goes here to send the mail   
      redirect_to manage_news_letter_path(@news_letter), notice: "Sent news Letter"        
  end 

我可以获得订阅者列表但是我如何将他们的电子邮件拆分为rails中的for_each方法,因为格式是我的哈希值。任何帮助谢谢。

示例输出在

之下

{" email" =>" xx@xx.com"," id" =>" xx",&# 34; euid" =>" xx"," email_type" =>" html"," ip_signup" => nil ," timestamp_signup" => nil," ip_opt" =>" 208.68.37.172"," timestamp_opt" =>&# 34; 2014-02-21 10:38:20"," member_rating" => 2," info_changed" =>" 2014-02-21 10 :38:20"," web_id" => xx," leid" => xx,"语言" => nil,&#34 ; list_id" =>" xx"," list_name" =>" Blanckdigital网站列表","合并" => {" EMAIL" =>" xx@xx.com"," FNAME" =>""," LNAME& #34; =>""},"状态" =>"订阅","时间戳" =>&#34 ; 2014-02-21 10:38:20"," is_gmonkey" => false," list" => []," geo" => [],"客户" => []," static_segments" => [],"注意" => []}

我想要的只是每个订阅者的电子邮件xx@xx.com

0 个答案:

没有答案