2016-03-22 18 views

cevap

1

oluşturmak kullanmalıdır

def add_to_mailchimp(email_address, first_name, last_name) 
    list_id = "your_list_id" 
    gibbon = Gibbon::Request.new 
    # only need the md5_email if you want to use 'upsert' (find_or_create_by) or 'update', not 'create' 
    md5_email = Digest::MD5.hexdigest(email_address) 

    gibbon.lists(list_id).members(md5_email).upsert(body: {email_address: email_address, status: "subscribed", merge_fields: {FNAME: first_name, LNAME: last_name}}) 
    end 
1

muhtemelen onların API ile çalışmak Gibbon, bir MailChimp sarıcı kullanmak ister düzenli Kullanıcı sonra kancanın

class User < ActiveRecord::Base 
    after_create :send_to_mailchimp 

    def send_to_mailchimp 
    # send data to mailchimp 
    end 
end 
İlgili konular