mad_mimi_two 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mad_mimi_two/mad_mimi_mailer.rb +15 -5
- metadata +3 -3
@@ -39,8 +39,8 @@ module MadMimiTwo
|
|
39
39
|
end
|
40
40
|
res
|
41
41
|
end
|
42
|
-
def get_promotions_xml
|
43
|
-
url="#{API_URL}promotions.xml
|
42
|
+
def get_promotions_xml(page)
|
43
|
+
url="#{API_URL}promotions.xml?page=#{page}&#{MadMimiTwo::MadMimiMessage.api_settings.madmimiurlencode}"
|
44
44
|
xml_list=send_cmd(url)
|
45
45
|
end
|
46
46
|
def get_audience_xml
|
@@ -55,9 +55,9 @@ module MadMimiTwo
|
|
55
55
|
end
|
56
56
|
#/audience_lists/{name_of_list}/add?email={email_to_add}
|
57
57
|
# get a hash of promotion names on mad mimi. Not certain why mad mimi returns mailing details in this call but we throw it away.
|
58
|
-
def
|
59
|
-
xml_list=get_promotions_xml
|
60
|
-
res={
|
58
|
+
def get_promotions_internal(page)
|
59
|
+
xml_list=get_promotions_xml(page)
|
60
|
+
res={}
|
61
61
|
# puts "xml_list is #{xml_list}"
|
62
62
|
if !xml_list.nil? && xml_list != 'problem retrieving status: nil' then
|
63
63
|
reader = Nokogiri::XML::Reader(xml_list)
|
@@ -67,6 +67,16 @@ module MadMimiTwo
|
|
67
67
|
end
|
68
68
|
res
|
69
69
|
end
|
70
|
+
def get_promotions
|
71
|
+
res={'select promotion'=>'select promotion'}
|
72
|
+
1.upto(5) { |i| #only up to three pages now
|
73
|
+
#puts "i is #{i}"
|
74
|
+
tmp=get_promotions_internal(i)
|
75
|
+
break if tmp.empty?
|
76
|
+
res= res.merge(tmp)
|
77
|
+
}
|
78
|
+
res
|
79
|
+
end
|
70
80
|
def get_lists
|
71
81
|
xml_list=get_audience_xml
|
72
82
|
res={'select list'=>'select list'}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mad_mimi_two
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 8
|
10
|
+
version: 0.6.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- scott sproule
|