ecircle 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/Gemfile.lock +1 -1
- data/lib/ecircle/client.rb +1 -1
- data/lib/ecircle/configuration.rb +1 -1
- data/lib/ecircle/job_package.rb +48 -40
- data/lib/ecircle/version.rb +1 -1
- metadata +13 -13
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/ecircle/client.rb
CHANGED
@@ -4,7 +4,7 @@ module Ecircle
|
|
4
4
|
ENDPOINT = 'http://webservices.ecircle-ag.com/rpc'
|
5
5
|
NAMESPACE = "http://webservices.ecircleag.com/rpcns"
|
6
6
|
|
7
|
-
attr_accessor :user, :password, :
|
7
|
+
attr_accessor :user, :password, :sync_realm, :async_realm, :wsdl, :endpoint, :namespace
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@wsdl = WSDL
|
data/lib/ecircle/job_package.rb
CHANGED
@@ -2,59 +2,67 @@ module Ecircle
|
|
2
2
|
module JobPackage
|
3
3
|
TARGET_CONTENT_ENCODING = 'ISO-8859-1'
|
4
4
|
|
5
|
-
def self.
|
6
|
-
|
5
|
+
def self.send_async_message_to_group(options)
|
6
|
+
client = Savon::Client.new do
|
7
|
+
wsdl.endpoint = 'http://webservices.ecircle-ag.com/ws'
|
8
|
+
wsdl.namespace = "http://webservices.ecircleag.com/ws"
|
9
|
+
end
|
10
|
+
|
11
|
+
response = client.request :control, 'xmlns' => "http://webservices.ecircle-ag.com/ecm", 'request-id' => options[:request_id], 'group-id' => options[:group_id] do
|
12
|
+
soap.header = { :authenticate => { :realm => Ecircle.configuration.async_realm,
|
13
|
+
:email => Ecircle.configuration.user,
|
14
|
+
:password => Ecircle.configuration.password },
|
15
|
+
:attributes! => { :authenticate => { "xmlns" => "http://webservices.ecircle-ag.com/ws" } } }
|
16
|
+
soap.body = soap_body(options)
|
17
|
+
end
|
7
18
|
end
|
8
19
|
|
9
|
-
def self.
|
20
|
+
def self.soap_body(options)
|
10
21
|
xml = Builder::XmlMarkup.new(:indent => 2)
|
11
|
-
xml.
|
12
|
-
|
13
|
-
|
14
|
-
xml.tag! '
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
xml.message 'message-id' => 'new', 'delete' => 'false' do
|
23
|
+
xml.tag! 'sendout-preferences' do
|
24
|
+
xml.tag! 'object-handling', 'html-images' => 'untouched'
|
25
|
+
xml.tag! 'email-channel', 'preferred-format' => 'email-html-multipart'
|
26
|
+
end
|
27
|
+
xml.tag! 'send-date' do
|
28
|
+
xml.date Helper.date_format(options[:send_out_date])
|
29
|
+
end
|
30
|
+
xml.tag! 'send-report-address' do
|
31
|
+
xml.tag! 'email-address' do
|
32
|
+
xml.email options[:report_email]
|
33
|
+
xml.name "Send report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
|
20
34
|
end
|
21
|
-
|
35
|
+
end
|
36
|
+
xml.tag! 'status-report', 'report-id' => 'new', 'delete' => 'false', 'user-tracking-details' => 'false', 'link-tracking-details' => 'false', 'bouncing-details' => 'false' do
|
37
|
+
xml.tag! 'report-address' do
|
22
38
|
xml.tag! 'email-address' do
|
23
39
|
xml.email options[:report_email]
|
24
|
-
xml.name "
|
40
|
+
xml.name "Status report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
|
25
41
|
end
|
26
42
|
end
|
27
|
-
xml.tag! '
|
28
|
-
xml.
|
29
|
-
xml.tag! 'email-address' do
|
30
|
-
xml.email options[:report_email]
|
31
|
-
xml.name "Status report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
xml.tag! 'send-date' do
|
35
|
-
xml.date Helper.date_format(options[:send_date_for_report])
|
36
|
-
end
|
37
|
-
end
|
38
|
-
xml.content 'target-content-encoding' => TARGET_CONTENT_ENCODING do
|
39
|
-
xml.subject options[:subject], 'target-encoding' => TARGET_CONTENT_ENCODING
|
40
|
-
xml.text options[:text], 'target-content-encoding' => TARGET_CONTENT_ENCODING
|
41
|
-
xml.html options[:html], 'target-content-encoding' => TARGET_CONTENT_ENCODING
|
43
|
+
xml.tag! 'send-date' do
|
44
|
+
xml.date Helper.date_format(options[:send_date_for_report])
|
42
45
|
end
|
43
46
|
end
|
44
|
-
xml.
|
45
|
-
xml.
|
46
|
-
|
47
|
-
|
48
|
-
end
|
47
|
+
xml.content 'target-content-encoding' => TARGET_CONTENT_ENCODING do
|
48
|
+
xml.subject options[:subject], 'target-encoding' => TARGET_CONTENT_ENCODING
|
49
|
+
xml.text options[:text], 'target-content-encoding' => TARGET_CONTENT_ENCODING
|
50
|
+
xml.html options[:html], 'target-content-encoding' => TARGET_CONTENT_ENCODING
|
49
51
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
end
|
53
|
+
xml.tag! 'success-report-address' do
|
54
|
+
xml.tag! 'email-address' do
|
55
|
+
xml.email options[:report_email]
|
56
|
+
xml.name "Success report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
xml.tag! 'failure-report-address' do
|
60
|
+
xml.tag! 'email-address' do
|
61
|
+
xml.email options[:report_email]
|
62
|
+
xml.name "Failure report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
|
55
63
|
end
|
56
64
|
end
|
57
65
|
xml.target!
|
58
66
|
end
|
59
67
|
end
|
60
|
-
end
|
68
|
+
end
|
data/lib/ecircle/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecircle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-10-25 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &81915150 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *81915150
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: i18n
|
27
|
-
requirement: &
|
27
|
+
requirement: &81914550 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *81914550
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &81914140 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *81914140
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: savon
|
49
|
-
requirement: &
|
49
|
+
requirement: &81913720 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.7
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *81913720
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &81879230 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - =
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 2.6.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *81879230
|
69
69
|
description: The ecircle gem aims to be a full-fledged client for all ecircle services.
|
70
70
|
email:
|
71
71
|
- timo.roessner@googlemail.com
|
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
segments:
|
104
104
|
- 0
|
105
|
-
hash: -
|
105
|
+
hash: -975259857
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
segments:
|
113
113
|
- 0
|
114
|
-
hash: -
|
114
|
+
hash: -975259857
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project: ecircle
|
117
117
|
rubygems_version: 1.8.6
|