ruby-mailchimp 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mail_chimp.rb +28 -4
- metadata +2 -2
data/lib/mail_chimp.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'net/imap'
|
3
3
|
require 'rubygems'
|
4
|
-
require 'xmlrpc
|
4
|
+
require 'xmlrpc/client'
|
5
5
|
gem 'actionmailer'
|
6
6
|
require 'action_mailer'
|
7
7
|
|
@@ -28,8 +28,9 @@ require 'action_mailer'
|
|
28
28
|
# bonobo = MailChimp.new
|
29
29
|
# uid = bonobo.login("MailChimpUsername", "MailChimpPassword")
|
30
30
|
#
|
31
|
-
# - Obtaining a List
|
32
|
-
#
|
31
|
+
# - Obtaining a List -
|
32
|
+
# list = bonobo.getListByName(uid, "My List on MailChimp")
|
33
|
+
# list_id = list["id"]
|
33
34
|
#
|
34
35
|
# - Subscribing a User: -
|
35
36
|
# bonobo.listSubscribe(uid, list_id, "testuser@nowhere.com", {})
|
@@ -42,7 +43,7 @@ require 'action_mailer'
|
|
42
43
|
#
|
43
44
|
class MailChimp
|
44
45
|
API_URL = "http://api.mailchimp.com/1.1/"
|
45
|
-
attr_accessor :email_server, :email_user, :email_password,
|
46
|
+
attr_accessor :email_server, :email_user, :email_password, :client
|
46
47
|
@client = nil
|
47
48
|
|
48
49
|
def login(username, password)
|
@@ -329,13 +330,36 @@ class MailChimp
|
|
329
330
|
@client = XMLRPC::Client.new2(API_URL) if @client.nil?
|
330
331
|
@client.call("campaignSendNow", uid, campaign_id)
|
331
332
|
end
|
333
|
+
|
334
|
+
def campaignSegmentTest(uid, list_id, options)
|
335
|
+
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
336
|
+
@client = XMLRPC::Client.new2(API_URL) if @client.nil?
|
337
|
+
@client.call("campaignSegmentTest", uid, campaign_id, options)
|
338
|
+
end
|
332
339
|
|
340
|
+
def campaignTemplates(uid)
|
341
|
+
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
342
|
+
@client = XMLRPC::Client.new2(API_URL) if @client.nil?
|
343
|
+
@client.call("campaignTemplates", uid)
|
344
|
+
end
|
345
|
+
|
333
346
|
def campaignUnschedule(uid, campaign_id)
|
334
347
|
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
335
348
|
@client = XMLRPC::Client.new2(API_URL) if @client.nil?
|
336
349
|
@client.call("campaignUnschedule", uid, campaign_id)
|
337
350
|
end
|
338
351
|
|
352
|
+
def campaignUpdate(uid, campaign_id, name, value)
|
353
|
+
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
354
|
+
@client = XMLRPC::Client.new2(API_URL) if @client.nil?
|
355
|
+
@client.call("campaignUpdate", uid, campaign_id, name, value)
|
356
|
+
end
|
357
|
+
|
358
|
+
def campaigns(uid, filter_id, filter_folder, filter_fromname, filter_fromemail, filter_title, filter_subject, filter_sendtimestart, filter_sendtimeend, filter_exact, start, limit)
|
359
|
+
raise StandardError("Not Loggged in or invalid UID.") if (uid.nil?)
|
360
|
+
@client = XMLRPC::Client.new2(API_URL) if @client.nil?
|
361
|
+
@client.call("campaigns", uid, filter_id, filter_folder, filter_fromname, filter_fromemail, filter_title, filter_subject, filter_sendtimestart, filter_sendtimeend, filter_exact, start, limit)
|
362
|
+
end
|
339
363
|
|
340
364
|
|
341
365
|
|
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.5.
|
4
|
+
version: 0.5.1
|
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-12-09 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|