Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

More advanced examples #29

Merged
merged 3 commits into from

2 participants

@nellshamrell

Hello!

I used your API wrapper quite extensively in writing an API between Mailchimp and one of our systems. Based on that work, I've added a few more examples that I figured might be useful to other users.

Great gem, btw, it was incredibly useful!

@amro
Owner

Thank you very much!

@amro amro merged commit 5722ef7 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 28, 2012
  1. @nellshamrell
  2. @nellshamrell

    cleaning up spacing

    nellshamrell authored
  3. @nellshamrell

    grammar correction

    nellshamrell authored
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 1 deletion.
  1. +23 −1 README.markdown
View
24 README.markdown
@@ -46,7 +46,7 @@ For example, to fetch your first 100 campaigns (page 0):
Similarly, to fetch your first 100 lists:
lists = gb.lists({:start => 0, :limit=> 100})
-
+
Or, to fetch a list by name:
list = gb.lists({:filters => {:list_name => list_name}})
@@ -61,6 +61,28 @@ or
info = gb.listMemberInfo({:id => list_id, :email_address => email_array})
+List subscribers for a list:
+
+ gb.list_members({:id => list_id})
+
+or
+
+List unsubscribed members for a list
+
+ gb.list_members({:id => list_id, :status => "unsubscribed"})
+
+Subscribe a member to a list:
+
+ gb.list_subscribe({:id => list_id, :email_address => "email_address", :merge_vars => {:FNAME => "First Name", :LNAME => "Last Name"}})
+Note: This will send a welcome email to the new subscriber
+
+or
+
+Batch subscribe members to a list:
+
+ gb.list_batch_subscribe(:id => list_id, :batch => [{:EMAIL => "email1", :FNAME => "FirstName1", :LNAME => "LastName1"},{:EMAIL => "email2", :FNAME => "FirstName2", :LNAME => "LastName2"}])
+Note: This will send welcome emails to the new subscribers
+
Fetch open and click detail for recipients of a particular campaign:
email_stats = gb.campaign_email_stats_aim({:cid => campaign_id, :email_address => email_array})
Something went wrong with that request. Please try again.