mad_mimi_two 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/lib/mad_mimi_two/mad_mimi_mailer.rb +4 -1
- data/test/test_mad_mimi_two.rb +21 -0
- metadata +3 -3
data/History.txt
CHANGED
@@ -19,6 +19,7 @@ module MadMimiTwo
|
|
19
19
|
def self.included(base)
|
20
20
|
base.extend(ClassMethods)
|
21
21
|
end
|
22
|
+
# send http get url via http client wrapped with exception rescue code
|
22
23
|
def send_cmd(url)
|
23
24
|
begin
|
24
25
|
client= HTTPClient.new
|
@@ -32,6 +33,7 @@ module MadMimiTwo
|
|
32
33
|
url="#{API_URL}promotions.xml?#{MadMimiTwo::MadMimiMessage.api_settings.madmimiurlencode}"
|
33
34
|
xml_list=send_cmd(url)
|
34
35
|
end
|
36
|
+
# 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.
|
35
37
|
def get_promotions
|
36
38
|
xml_list=get_promotions_xml
|
37
39
|
res={}
|
@@ -113,7 +115,8 @@ module MadMimiTwo
|
|
113
115
|
'subject' => self[:subject].to_s,
|
114
116
|
'bcc' => serialize(self[:bcc].to_s.split(',') || MadMimiMailer.default_parameters[:bcc]),
|
115
117
|
'from' => (self[:from].to_s || MadMimiMailer.default_parameters[:from]),
|
116
|
-
'hidden' => serialize(self.hidden)
|
118
|
+
'hidden' => serialize(self.hidden),
|
119
|
+
'reply_to' => self[:reply_to].to_s# if !self[:reply_to].nil?
|
117
120
|
}
|
118
121
|
params['body']= self.email_placeholders.to_yaml
|
119
122
|
# puts "params: #{params.inspect} to string #{params.to_s}"
|
data/test/test_mad_mimi_two.rb
CHANGED
@@ -68,6 +68,27 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
68
68
|
email_placeholders thash # :user => tuser, :url => turl
|
69
69
|
content_type "text/html"
|
70
70
|
end
|
71
|
+
r=t.deliver_mimi_message
|
72
|
+
puts "result: #{r} message: #{t.inspect}"
|
73
|
+
assert t.headers.size==0, "headers not empty"
|
74
|
+
assert t[:to].to_s=='scott.sproule@ficonab.com', "to person not correct #{t[:to]}"
|
75
|
+
assert t.promotion.to_s=='new_crm', 'promotion first wrong'
|
76
|
+
#assert t[:promotion].to_s=='new_crm', 'promotion wrong'
|
77
|
+
end
|
78
|
+
def test_reply_to # PLEASE NOTE THAT YOUR MAD MIMI ACCOUNT NEEDS PROMOTION CALLED new_crm accepting user and url
|
79
|
+
thash={:user => 'test', :url => 'test.estormtech.com' }
|
80
|
+
t=MadMimiTwo::MadMimiMessage.new do
|
81
|
+
subject 'email from test case: test_reply_to'
|
82
|
+
to 'scott.sproule@ficonab.com'
|
83
|
+
reply_to 'scott reply <scott.sproule@ficonab.com>'
|
84
|
+
# cc admin
|
85
|
+
promotion 'new_crm'
|
86
|
+
from 'support@estormtech.com'
|
87
|
+
bcc ["scott.sproule@estormtech.com", "eka.mardiarti@estormtech.com"]
|
88
|
+
# sent_on Time.now
|
89
|
+
email_placeholders thash # :user => tuser, :url => turl
|
90
|
+
content_type "text/html"
|
91
|
+
end
|
71
92
|
# t.email_placeholders(thash)
|
72
93
|
r=t.deliver_mimi_message
|
73
94
|
puts "result: #{r} message: #{t.inspect}"
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 9
|
10
|
+
version: 0.5.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- scott sproule
|