emaildirect 1.3.4 → 2.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2af014199259e6e99bb9d82844c409b00ab030df
4
- data.tar.gz: 4c1a6e970a1be200da9993e75894f72c9d7c37cf
3
+ metadata.gz: 89931c15e67470b09fbf3607afefa532a1d2abb2
4
+ data.tar.gz: dff747d86b4d1dd97d331e1d1b5a9d4c29d841c6
5
5
  SHA512:
6
- metadata.gz: 1935e3566452e189b47eab38740db92fa552dc480969df7a20d245254d1ca8f2628c99bbf2569289378f1642dfe96c379975cdac795310817a95c8450c39a9da
7
- data.tar.gz: c203147ff18771a52b2f0365e6f729353be3c05c486f1327c5d164786064288390913cccce272774565f77501dfaaa2279c05ec03da924600a4605ce189ffa95
6
+ metadata.gz: 7c733278051717cc47d4d130ef263bc0b9e89aeab160422736d72e2e65f78d0385ac30a4e917a8e7a69db17bcc353deacfd3e2b809974fc4ddfbf9294524e20b
7
+ data.tar.gz: a698727335665a2af9aba60fe0737537689f52ef64ec82cb80b3c7c39ac1b4ea08353dae615e1ca41ec85045733106345d399a014566a624d899668d620b5732
@@ -1,25 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- emaildirect (1.3.4)
5
- hashie (>= 3.0.0)
4
+ emaildirect (2.0.0)
5
+ hashie (<= 2.1.2)
6
6
  httparty
7
7
  json
8
8
 
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- hashie (3.3.1)
12
+ hashie (2.1.2)
13
13
  httparty (0.15.5)
14
14
  multi_xml (>= 0.5.2)
15
15
  json (2.1.0)
16
16
  multi_xml (0.6.0)
17
+ rake (11.1.2)
17
18
 
18
19
  PLATFORMS
19
20
  ruby
20
21
 
21
22
  DEPENDENCIES
22
23
  emaildirect!
24
+ rake
23
25
 
24
26
  BUNDLED WITH
25
27
  1.14.6
data/HISTORY.md CHANGED
@@ -1,4 +1,8 @@
1
- ## 1.3.4 (Jun 2, 2017)
1
+ ## 2.0.0 (Jun 7, 2017)
2
+ * Switched API endpoint to Campaigner.
3
+ * Locked Hashie <= 2.1.2
4
+
5
+ ## 1.3.4 (Jun 7, 2017)
2
6
  * Hashie >= 3.0.0
3
7
 
4
8
  ## 1.3.3 (Aug 29, 2012)
@@ -26,5 +30,4 @@
26
30
  * Authentication is done using a header instead of basic auth so FakeWeb is easier to use.
27
31
 
28
32
  ## 1.0.0 (Dec. 12th, 2011)
29
-
30
33
  * Initial release
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # Note
2
- EmailDirect is now [Campaigner](http://campaigner.com/). `v2.0.0` will address all these changes.
2
+
3
+ EmailDirect is now [Campaigner](http://campaigner.com/).
4
+ The API endpoint, https://edapi.campaigner.com/v1/, was created by Campaigner to handle old EmailDirect API.
3
5
  Use `v1.3.4` if you use `Hashie >= 3.0.0`.
4
6
 
5
7
  # emaildirect
6
8
 
7
- A ruby library which implements the complete functionality of the REST (v5) [Email Direct API](https://docs.emaildirect.com).
9
+ A ruby library which implements the complete functionality of the REST [Campaigner EmailDirect API](https://media.campaigner.com/apidocs/edapi/#overview).
8
10
 
9
11
  ## Installation
10
12
 
@@ -37,7 +39,7 @@ Results in:
37
39
 
38
40
  ### Create, then remove a Publication
39
41
 
40
- response = EmailDirect::Publication.create('Test', :Description => 'Test Publication')
42
+ response = EmailDirect::Publication.create('Test', Description: 'Test Publication')
41
43
  sub = EmailDirect::Publication.new(response.publicationID)
42
44
  sub.delete
43
45
 
@@ -45,32 +47,32 @@ Results in:
45
47
 
46
48
  A single attribute:
47
49
 
48
- EmailDirect::Subscriber.new(email).update_custom_field :FirstName, 'Pat'
50
+ EmailDirect::Subscriber.new(email).update_custom_field(:FirstName, 'Pat')
49
51
 
50
52
  Multiple attributes:
51
53
 
52
- EmailDirect::Subscriber.new(email).update_custom_fields :FirstName => 'Pam', :LastName => 'Sinivas'
54
+ EmailDirect::Subscriber.new(email).update_custom_fields(FirstName: 'Pam', LastName: 'Sinivas')
53
55
 
54
56
  When creating a subscriber
55
57
 
56
- EmailDirect::Subscriber.create(email, :Publications => [1], :CustomFields => { :FirstName => 'Pam', :LastName => 'Sinivas' }
58
+ EmailDirect::Subscriber.create(email, Publications: [1], CustomFields: { FirstName: 'Pam', LastName: 'Sinivas' })
57
59
 
58
60
  ### ActionMailer integration
59
61
  You can use send your ActionMailer email through Email Direct using their Relay Send functionality by setting up a new delivery method in an initalizer:
60
62
 
61
63
  ActionMailer::Base.add_delivery_method :emaildirect, EmailDirect::Mailer,
62
- :category_id => 1,
63
- :options => { :Force => true }
64
+ category_id: 1,
65
+ options: { Force: true }
64
66
 
65
67
  And in your ActionMailer class:
66
68
 
67
- defaults :delivery_method => :emaildirect
69
+ defaults delivery_method: :emaildirect
68
70
 
69
71
  or for just a particular message:
70
72
 
71
73
  def welcome(user) do
72
- mail :to => user.email,
73
- :delivery_method => :emaildirect
74
+ mail to: user.email,
75
+ delivery_method: :emaildirect
74
76
  end
75
77
 
76
78
  ### Handling errors
@@ -98,8 +100,7 @@ A helper method is provided to disable talking to the EmailDirect REST server (r
98
100
  EmailDirect.disable
99
101
 
100
102
  ### Expected input and output
101
- The best way of finding out the expected input and output of a particular method in a particular class is to read the [API docs](https://docs.emaildirect.com)
102
- and take a look at the code for that function.
103
+ The best way of finding out the expected input and output of a particular method in a particular class is to read the [API docs](https://media.campaigner.com/apidocs/edapi/#overview) and take a look at the code for that function.
103
104
 
104
105
  ## Credits
105
106
  - Jason Rust
@@ -18,7 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.platform = Gem::Platform::RUBY
19
19
  s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
20
20
 
21
+ s.add_development_dependency 'rake'
21
22
  s.add_runtime_dependency 'json'
22
- s.add_runtime_dependency 'hashie', '>= 3.0.0'
23
+ s.add_runtime_dependency 'hashie', '<= 2.1.2'
23
24
  s.add_runtime_dependency 'httparty'
24
25
  end
@@ -2,7 +2,7 @@ require 'cgi'
2
2
  require 'uri'
3
3
  require 'httparty'
4
4
  require 'hashie'
5
- Hash.send :include, Hashie::Extensions
5
+ Hash.send :include, Hashie::HashExtensions
6
6
 
7
7
  libdir = File.dirname(__FILE__)
8
8
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
@@ -34,7 +34,7 @@ module EmailDirect
34
34
  def api_key=(api_key)
35
35
  EmailDirect.api_key = api_key
36
36
  end
37
-
37
+
38
38
  def base_uri=(uri)
39
39
  EmailDirect.base_uri uri
40
40
  end
@@ -64,10 +64,10 @@ module EmailDirect
64
64
 
65
65
  class EmailDirect
66
66
  include HTTParty
67
-
68
- @@base_uri = "https://rest.emaildirect.com/v1/"
69
- @@api_key = ""
70
- headers({
67
+
68
+ @@base_uri = 'https://edapi.campaigner.com/v1/'
69
+ @@api_key = ''
70
+ headers({
71
71
  'User-Agent' => "emaildirect-rest-#{VERSION}",
72
72
  'Content-Type' => 'application/json; charset=utf-8',
73
73
  'Accept-Encoding' => 'gzip, deflate',
@@ -1,3 +1,3 @@
1
1
  module EmailDirect
2
- VERSION = "1.3.4" unless defined?(EmailDirect::VERSION)
2
+ VERSION = "2.0.0" unless defined?(EmailDirect::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emaildirect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Rust
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: json
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -28,16 +42,16 @@ dependencies:
28
42
  name: hashie
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ">="
45
+ - - "<="
32
46
  - !ruby/object:Gem::Version
33
- version: 3.0.0
47
+ version: 2.1.2
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ">="
52
+ - - "<="
39
53
  - !ruby/object:Gem::Version
40
- version: 3.0.0
54
+ version: 2.1.2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: httparty
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -117,4 +131,3 @@ specification_version: 4
117
131
  summary: A library which implements the complete functionality of of the emaildirect
118
132
  REST API (v5).
119
133
  test_files: []
120
- has_rdoc: