mailerlite 1.5.0 → 1.6.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 +4 -4
- data/.rubocop.yml +0 -3
- data/Gemfile +3 -3
- data/README.md +0 -2
- data/examples/README.md +1 -0
- data/examples/segments.md +7 -0
- data/examples/subscribers.md +6 -0
- data/lib/mailerlite/client.rb +2 -0
- data/lib/mailerlite/clients/segments.rb +15 -0
- data/lib/mailerlite/clients/subscribers.rb +14 -0
- data/lib/mailerlite/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e837c40766e3a40363c6aa6f317735704de9f0ece713f1a0a5da6b1a2b1079f
|
4
|
+
data.tar.gz: 8097a5fd8feafb51ee91c8677ff358704abd1d431611ad50f49942ac743be4ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d8b1054ea4bd7241393375e81edffa6176e0fcc846f098e400b684e5798ba30453c9601f625001e9521efa6ed60d4a3705e9d55c4f8ad871e8a2a8b9d5b2dd2
|
7
|
+
data.tar.gz: 2cac9bec497c1810097f4689b5cb2511a8b171061b357925eb13d6b2930dc3c6be809f1cfb04a901e65cb6f32a555641cb82d5a8b4feecae57f52605d7e0ae8d
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
gem 'rubocop', '~> 0.
|
4
|
+
gem 'rubocop', '~> 0.57'
|
5
5
|
end
|
6
6
|
|
7
7
|
group :development, :test do
|
@@ -11,8 +11,8 @@ end
|
|
11
11
|
group :test do
|
12
12
|
gem 'rake' # For Travis CI
|
13
13
|
gem 'rspec', '~> 3.7'
|
14
|
-
gem 'simplecov', '~> 0.
|
15
|
-
gem 'webmock', '~> 3.
|
14
|
+
gem 'simplecov', '~> 0.16', require: false
|
15
|
+
gem 'webmock', '~> 3.4'
|
16
16
|
end
|
17
17
|
|
18
18
|
gemspec
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ A Ruby gem which helps to communicate with [MailerLite][mailerlite] API.
|
|
4
4
|
|
5
5
|
[][rubygems]
|
6
6
|
[][travis]
|
7
|
-
[][gemnasium]
|
8
7
|
[][codeclimate]
|
9
8
|
[][codeclimate_coverage]
|
10
9
|
|
@@ -73,7 +72,6 @@ Copyright (c) 2018 Justas Palumickas. See [LICENSE][license] for details.
|
|
73
72
|
|
74
73
|
[rubygems]: https://rubygems.org/gems/mailerlite
|
75
74
|
[travis]: https://travis-ci.org/jpalumickas/mailerlite-ruby
|
76
|
-
[gemnasium]: https://gemnasium.com/jpalumickas/mailerlite-ruby
|
77
75
|
[codeclimate]: https://codeclimate.com/github/jpalumickas/mailerlite-ruby
|
78
76
|
[codeclimate_coverage]: https://codeclimate.com/github/jpalumickas/mailerlite-ruby/test_coverage
|
79
77
|
|
data/examples/README.md
CHANGED
data/examples/subscribers.md
CHANGED
data/lib/mailerlite/client.rb
CHANGED
@@ -5,6 +5,7 @@ require 'mailerlite/clients/account'
|
|
5
5
|
require 'mailerlite/clients/campaigns'
|
6
6
|
require 'mailerlite/clients/fields'
|
7
7
|
require 'mailerlite/clients/groups'
|
8
|
+
require 'mailerlite/clients/segments'
|
8
9
|
require 'mailerlite/clients/subscribers'
|
9
10
|
require 'mailerlite/clients/webhooks'
|
10
11
|
|
@@ -15,6 +16,7 @@ module MailerLite
|
|
15
16
|
include MailerLite::Clients::Campaigns
|
16
17
|
include MailerLite::Clients::Fields
|
17
18
|
include MailerLite::Clients::Groups
|
19
|
+
include MailerLite::Clients::Segments
|
18
20
|
include MailerLite::Clients::Subscribers
|
19
21
|
include MailerLite::Clients::Webhooks
|
20
22
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module MailerLite
|
2
|
+
module Clients
|
3
|
+
# MailerLite Segments
|
4
|
+
module Segments
|
5
|
+
# Get list of segments
|
6
|
+
#
|
7
|
+
# @see https://developers.mailerlite.com/v2/reference#segments-1
|
8
|
+
#
|
9
|
+
# @return [Array] Response from API.
|
10
|
+
def segments
|
11
|
+
connection.get('segments')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -13,6 +13,20 @@ module MailerLite
|
|
13
13
|
connection.get("subscribers/#{identifier}")
|
14
14
|
end
|
15
15
|
|
16
|
+
# Create subscriber
|
17
|
+
#
|
18
|
+
# @see https://developers.mailerlite.com/v2/reference#create-a-subscriber
|
19
|
+
#
|
20
|
+
# @param identifier [Integer,String] ID or email of subscriber.
|
21
|
+
# @param params [Hash] Params list. See more in MailerLite docs.
|
22
|
+
# @option options [String] :email Required. Email of new subscriber.
|
23
|
+
# @option options [String] :name Subscriber name.
|
24
|
+
#
|
25
|
+
# @return [Hash] Response from API.
|
26
|
+
def create_subscriber(params = {})
|
27
|
+
connection.post('subscribers', params)
|
28
|
+
end
|
29
|
+
|
16
30
|
# Update single subscriber
|
17
31
|
#
|
18
32
|
# @see https://developers.mailerlite.com/v2/reference#update-subscriber
|
data/lib/mailerlite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailerlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justas Palumickas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- examples/create_campaign.md
|
107
107
|
- examples/fields.md
|
108
108
|
- examples/groups.md
|
109
|
+
- examples/segments.md
|
109
110
|
- examples/subscribers.md
|
110
111
|
- examples/webhooks.md
|
111
112
|
- lib/mailerlite.rb
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- lib/mailerlite/clients/campaigns.rb
|
115
116
|
- lib/mailerlite/clients/fields.rb
|
116
117
|
- lib/mailerlite/clients/groups.rb
|
118
|
+
- lib/mailerlite/clients/segments.rb
|
117
119
|
- lib/mailerlite/clients/subscribers.rb
|
118
120
|
- lib/mailerlite/clients/webhooks.rb
|
119
121
|
- lib/mailerlite/configuration.rb
|