ruby - Adding address to mailchimp using Gibbon gem -
im using gibbon 0.4.6 ruby 1.9.3p392, , tried add address of contacts couldn't find correct format of parameters.
respuesta = gb.listsubscribe({ :id => lista_id, :email_address => email, :merge_vars => {'fname' => nombre, 'lname' => apellido, 'mmerge3' => ['addr1' => 'aqui', 'addr2' => 'alla', 'city' => 'mexico df', 'zip' => '06700', 'country' => 'mx'] } })
update
as amro suggested, im using gibbon 1.0, have same problem:
i used this
respuesta = gb.lists.subscribe({ :id => lista_id, :email => {:email => email}, :merge_vars => {'fname' => nombre, 'lname' => apellido, 'mmerge3' => {'addr1' => 'aqui', 'addr2' => 'alla', 'city' => 'mexico df', 'zip' => '06700', 'country' => 'mx'}, 'mmerge4' => 'mi nota ' } })
but address(mmerge3) wasn't registered @ mailchimp.
any idea welcome.
your current code looks reasonable me. have tried passing "update_existing" value of true? if address subscribed won't work otherwise since "update_existing" defaults false.
old answer api 1.3
i'm gibbon's maintainer. in case, mailchimp's docs type "array," mean associative array (i.e. ruby hash). try this:
respuesta = gb.listsubscribe({ :id => lista_id, :email_address => email, :merge_vars => {'fname' => nombre, 'lname' => apellido, 'mmerge3' => {'addr1' => 'aqui', 'addr2' => 'alla', 'city' => 'mexico df', 'zip' => '06700', 'country' => 'mx'} } })
also, api 1.3 has been deprecated. suggest upgrading gibbon 1.0, hits mailchimp api 2.0. syntax little different sure check out 2.0 docs , gibbon's updated readme here.
Comments
Post a Comment