ruby-mailchimp 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mail_chimp.rb +10 -10
- metadata +2 -2
data/lib/mail_chimp.rb
CHANGED
@@ -41,17 +41,17 @@ require 'action_mailer'
|
|
41
41
|
# bonobo.listUnsubscribe(uid, list_id, "testuser@nowhere.com")
|
42
42
|
#
|
43
43
|
class MailChimp
|
44
|
-
|
44
|
+
API_URL = "http://api.mailchimp.com/1.0/"
|
45
45
|
attr_accessor :email_server, :email_user, :email_password, :client
|
46
46
|
|
47
47
|
def login(username, password)
|
48
|
-
client = XMLRPC::Client.new2(
|
48
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
49
49
|
client.call("login", username, password)
|
50
50
|
end
|
51
51
|
|
52
52
|
def lists(uid)
|
53
53
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
54
|
-
client = XMLRPC::Client.new2(
|
54
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
55
55
|
client.call("lists", uid)
|
56
56
|
end
|
57
57
|
|
@@ -72,43 +72,43 @@ class MailChimp
|
|
72
72
|
|
73
73
|
def listMergeVars(uid, list_id)
|
74
74
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
75
|
-
client = XMLRPC::Client.new2(
|
75
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
76
76
|
client.call("listMergeVars", uid, list_id)
|
77
77
|
end
|
78
78
|
|
79
79
|
def listInterestGroups(uid, list_id)
|
80
80
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
81
|
-
client = XMLRPC::Client.new2(
|
81
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
82
82
|
client.call("listInterestGroups", uid, list_id)
|
83
83
|
end
|
84
84
|
|
85
85
|
def listSubscribe(uid, list_id, email, merge_vars, email_type="html", double_optin=true)
|
86
86
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
87
|
-
client = XMLRPC::Client.new2(
|
87
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
88
88
|
client.call("listSubscribe", uid, list_id, email, merge_vars, email_type, double_optin)
|
89
89
|
end
|
90
90
|
|
91
91
|
def listUnsubscribe(uid, list_id, email, delete_member=false, send_goodbye=true, send_notify=true)
|
92
92
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
93
|
-
client = XMLRPC::Client.new2(
|
93
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
94
94
|
client.call("listUnsubscribe", uid, list_id, email, delete_member, send_goodbye, send_notify)
|
95
95
|
end
|
96
96
|
|
97
97
|
def listUpdateMember(uid, list_id, email, merge_vars, email_type, replace_interests=true)
|
98
98
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
99
|
-
client = XMLRPC::Client.new2(
|
99
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
100
100
|
client.call("listUpdateMember", uid, list_id, email, merge_vars, email_type, replace_interests)
|
101
101
|
end
|
102
102
|
|
103
103
|
def listMembers(uid, list_id, status)
|
104
104
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
105
|
-
client = XMLRPC::Client.new2(
|
105
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
106
106
|
client.call("listMembers", uid, list_id, status)
|
107
107
|
end
|
108
108
|
|
109
109
|
def listMemberInfo(uid, list_id, email)
|
110
110
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
111
|
-
client = XMLRPC::Client.new2(
|
111
|
+
client = XMLRPC::Client.new2(API_URL) if client.nil?
|
112
112
|
client.call("listMemberInfo", uid, list_id, email)
|
113
113
|
end
|
114
114
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-mailchimp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C. G. Brown
|
@@ -9,7 +9,7 @@ autorequire: mail_chimp
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-20 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|