Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to update all fields in MailChimp API batch subscribe using Ruby and Gibbon
    primarykey
    data
    text
    <p>I am using Ruby 1.9.3 without Rails and version 1.0.4 of the Gibbon gem. </p> <p>I have referrals populated with my list and can send the following to MailChimp with Gibbon. However, only the email address and email type fields are populated in the list in MailChimp. What am I doing wrong that is prohibiting all the merge fields from being imported via API? </p> <p>Here is the batch and map of the list. </p> <pre><code>referrals.each_slice(3) do |batch| begin prepared_batch = batch.map do |referral| { :EMAIL =&gt; {:email =&gt; referral['client_email']}, :EMAIL_TYPE =&gt; 'html', :MMERGE6 =&gt; referral['field_1'], :MMERGE7 =&gt; referral['field_2'], :MMERGE8 =&gt; referral['field_3'], :MMERGE9 =&gt; referral['field_4'], :MMERGE11 =&gt; referral['field_5'], :MMERGE12 =&gt; referral['field_6'], :MMERGE13 =&gt; referral['field_7'], :MMERGE14 =&gt; referral['field_8'], :MMERGE15 =&gt; referral['field_9'], :FNAME =&gt; referral['client_first_name'] } end @log.info("prepared_batch : #{prepared_batch}") result = @gibbon.lists.batch_subscribe( :id =&gt; @mc_list_id, :batch =&gt; prepared_batch, :double_optin =&gt; false, :update_existing =&gt; true ) @log.info("#{result}") rescue Exception =&gt; e @log.warn("Unable to load batch into mailchimp because #{e.message}") end end </code></pre> <p>The above executes successfully. However, only the email address and email type are populated but most of the fields should be populated. </p> <p>Here is my log output for one of the prepared_batches. I replaced the real values with Value. I used my own email for testing. </p> <pre><code>I, [2013-11-11T09:01:14.778907 #70827] INFO -- : prepared_batch : [{:EMAIL=&gt; {:email=&gt;"jason+6@marketingscience.co"}, :EMAIL_TYPE=&gt;"html", :MMERGE6=&gt;"Value", :MMERGE7=&gt;"Value", :MMERGE8=&gt;nil, :MMERGE9=&gt;nil, :MMERGE11=&gt;"8/6/13 0:00", :MMERGE12=&gt;"Value", :MMERGE13=&gt;nil, :MMERGE14=&gt;"10/18/13 19:09", :MMERGE15=&gt;"Value", :FNAME=&gt;"Value"}, {:EMAIL=&gt;{:email=&gt;"jason+7@marketingscience.co"}, :EMAIL_TYPE=&gt;"html", :MMERGE6=&gt;"Value", :MMERGE7=&gt;"Value", :MMERGE8=&gt;nil, :MMERGE9=&gt;nil, :MMERGE11=&gt;"8/6/13 0:00", :MMERGE12=&gt;"Value", :MMERGE13=&gt;nil, :MMERGE14=&gt;nil, :MMERGE15=&gt;"Value", :FNAME=&gt;"Value"}, {:EMAIL=&gt;{:email=&gt;"jason+8@marketingscience.co"}, :EMAIL_TYPE=&gt;"html", :MMERGE6=&gt;"Value", :MMERGE7=&gt;"Value", :MMERGE8=&gt;nil, :MMERGE9=&gt;nil, :MMERGE11=&gt;"8/7/13 0:00", :MMERGE12=&gt;"Value", :MMERGE13=&gt;nil, :MMERGE14=&gt;nil, :MMERGE15=&gt;"Value", :FNAME=&gt;"Value"}] </code></pre> <p>Here is the log output of result from the MailChimp call. </p> <pre><code>I, [2013-11-11T09:01:14.778691 #70827] INFO -- : {"add_count"=&gt;3, "adds"=&gt; [{"email"=&gt;"jason+3@marketingscience.co", "euid"=&gt;"ab512177b4", "leid"=&gt;"54637465"}, {"email"=&gt;"jason+4@marketingscience.co", "euid"=&gt;"eeb8388524", "leid"=&gt;"54637469"}, {"email"=&gt;"jason+5@marketingscience.co", "euid"=&gt;"7dbc84cb75", "leid"=&gt;"54637473"}], "update_count"=&gt;0, "updates"=&gt;[], "error_count"=&gt;0, "errors"=&gt;[]} </code></pre> <p>Any advice on how to get all the fields to update in MailChimp is appreciated. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload