mailkick 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76321359a2413e9e97430e88ffa1bdea99830e5e
4
- data.tar.gz: 670f814ee9ed48dd9b538f9ed23be64616ab65ee
3
+ metadata.gz: 71a67112599c83fefbdd086151fcf834a24c217f
4
+ data.tar.gz: 609f546b4a4f6a3dc7a5878cb2e0bd2d344e1a97
5
5
  SHA512:
6
- metadata.gz: b73507e59e778e21879cea81b8f8a566baf4f890ca96faadae085d291996ee61ca893d3edea51cea24ed85e0258cafaac5b59769d85dcb87895b39ca4082c055
7
- data.tar.gz: fa53579ac51115bc51fd925bb293828756c732a60a30f8fca44ce6f2d6e1bc187a9529e4be17b6869dcfedc6d3ccdabb465f1b787b3d360c754dc9b0f5a00d6b
6
+ metadata.gz: 8d0392c53613b8580030f0b57c9b953cf4863d746200d92a2662abb16fd677017426cc4809ac122244b2d0facc92deb1ee021e191c1181f629179791404155b9
7
+ data.tar.gz: 99df02fda98d46cbf4cb1ed07c52f73f62f0f54e87e59e23146cc1250efb40c7e13138b810644c6d13735fde036c506063ec7dc80834cb6b6f863df989e1c600
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.2.1
2
+
3
+ - Fixed errors with Rails 5+
4
+ - Fixed errors with the latest version of Gibbon
5
+
1
6
  ## 0.2.0
2
7
 
3
8
  - Added support for Rails 5.1
data/README.md CHANGED
@@ -109,7 +109,7 @@ Be sure `ENV["MANDRILL_APIKEY"]` is set.
109
109
  #### Mailchimp
110
110
 
111
111
  ```ruby
112
- gem 'gibbon'
112
+ gem 'gibbon', '>= 2'
113
113
  ```
114
114
 
115
115
  Be sure `ENV["MAILCHIMP_API_KEY"]` and `ENV["MAILCHIMP_LIST_ID"]` are set.
@@ -2,6 +2,6 @@ module Mailkick
2
2
  class OptOut < ActiveRecord::Base
3
3
  self.table_name = "mailkick_opt_outs"
4
4
 
5
- belongs_to :user, polymorphic: true
5
+ belongs_to :user, ActiveRecord::VERSION::MAJOR >= 5 ? {polymorphic: true, optional: true} : {polymorphic: true}
6
6
  end
7
7
  end
@@ -4,7 +4,7 @@ module Mailkick
4
4
  class Service
5
5
  class Mailchimp < Mailkick::Service
6
6
  def initialize(options = {})
7
- @gibbon = ::Gibbon::API.new(options[:api_key] || ENV["MAILCHIMP_API_KEY"])
7
+ @gibbon = ::Gibbon::Request.new(api_key: options[:api_key] || ENV["MAILCHIMP_API_KEY"])
8
8
  @list_id = options[:list_id] || ENV["MAILCHIMP_LIST_ID"]
9
9
  end
10
10
 
@@ -14,11 +14,11 @@ module Mailkick
14
14
  end
15
15
 
16
16
  def unsubscribes
17
- fetch(@gibbon.lists.members(id: @list_id, status: "unsubscribed"), "unsubscribe")
17
+ fetch(@gibbon.lists(@list_id).members.retrieve(params: {status: "unsubscribed"}).body["members"], "unsubscribe")
18
18
  end
19
19
 
20
20
  def spam_reports
21
- fetch(@gibbon.lists.abuse_reports(id: @list_id), "spam")
21
+ fetch(@gibbon.lists(@list_id).abuse_reports.retrieve.body["abuse_reports"], "spam")
22
22
  end
23
23
 
24
24
  def self.discoverable?
@@ -28,9 +28,9 @@ module Mailkick
28
28
  protected
29
29
 
30
30
  def fetch(response, reason)
31
- response["data"].map do |record|
31
+ response.map do |record|
32
32
  {
33
- email: record["email"],
33
+ email: record["email_address"],
34
34
  time: ActiveSupport::TimeZone["UTC"].parse(record["timestamp_opt"] || record["date"]),
35
35
  reason: reason
36
36
  }
@@ -1,3 +1,3 @@
1
1
  module Mailkick
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/mailkick.gemspec CHANGED
@@ -24,4 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler"
25
25
  spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency "minitest"
27
+ spec.add_development_dependency "sendgrid_toolkit"
28
+ spec.add_development_dependency "mandrill-api"
29
+ spec.add_development_dependency "gibbon", ">= 2"
30
+ spec.add_development_dependency "mailgun-ruby"
27
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-01 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -80,6 +80,62 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sendgrid_toolkit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: mandrill-api
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: gibbon
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '2'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: mailgun-ruby
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
83
139
  description: Email subscriptions made easy
84
140
  email:
85
141
  - andrew@chartkick.com
@@ -135,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
191
  version: '0'
136
192
  requirements: []
137
193
  rubyforge_project:
138
- rubygems_version: 2.5.1
194
+ rubygems_version: 2.6.13
139
195
  signing_key:
140
196
  specification_version: 4
141
197
  summary: Email subscriptions made easy