mailerlite-ruby 1.0.5 → 1.0.6
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/CHANGELOG.md +3 -0
- data/README.md +11 -11
- data/lib/mailerlite/groups/groups.rb +2 -2
- data/lib/mailerlite/subscribers/subscribers.rb +2 -2
- data/lib/mailerlite/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26476250e28b87cf289bba0eccaf6cb110569eb3a4b257a5c4a54ae2a26f1bdd
|
4
|
+
data.tar.gz: 1c8fa0e0cfe43eaf2984b7384dc5de09fc282431d9f916f774c011d33ce75c3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89df2ef7e930774ad86986d38de88653ee04dc899c91f93a5c96ce3d84a0a31121237233992d36ae5dbc2f4cc767c760707e9b4c8f31b9384db93139b893f45c
|
7
|
+
data.tar.gz: 12d1c9538bbb830ee4cc05a2e4b402a66bfd0b915b5849d9b532981b1b5ca40adfbe3216daf243c62021c1eaa4183dafd5a6bd72ee94748687b92beb9f496801
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -105,7 +105,7 @@ require "mailerlite-ruby"
|
|
105
105
|
# Intialize the class
|
106
106
|
subscribers = MailerLite::Subscribers.new
|
107
107
|
|
108
|
-
subscribers.fetch(filter: { status: 'active' })
|
108
|
+
subscribers.fetch(filter: { status: 'active' }, cursor: 'cursor')
|
109
109
|
```
|
110
110
|
|
111
111
|
### Create a subscriber
|
@@ -131,7 +131,7 @@ require "mailerlite-ruby"
|
|
131
131
|
# Intialize the class
|
132
132
|
subscribers = MailerLite::Subscribers.new
|
133
133
|
|
134
|
-
subscribers.update(
|
134
|
+
subscribers.update('some@email.com', fields: {'name': 'John', 'last_name': 'Doe'}, ip_address:'1.2.3.4', optin_ip:'1.2.3.4')
|
135
135
|
```
|
136
136
|
|
137
137
|
### Get a subscriber
|
@@ -176,7 +176,7 @@ require "mailerlite-ruby"
|
|
176
176
|
# Intialize the class
|
177
177
|
groups = MailerLite::Groups.new
|
178
178
|
|
179
|
-
groups.
|
179
|
+
groups.get(limit:10, page:1, filter:{'name': 'My'}, sort:'name')
|
180
180
|
```
|
181
181
|
|
182
182
|
### Create a group
|
@@ -227,10 +227,10 @@ groups.delete(group_id)
|
|
227
227
|
```ruby
|
228
228
|
require "mailerlite-ruby"
|
229
229
|
|
230
|
-
#
|
230
|
+
# Initialize the class
|
231
231
|
groups = MailerLite::Groups.new
|
232
232
|
|
233
|
-
groups.get_subscribers(group_id:1234567,
|
233
|
+
groups.get_subscribers(group_id: 1234567, cursor: 'cursor', limit: 10, filter: { 'status': 'active' })
|
234
234
|
```
|
235
235
|
|
236
236
|
### Assign subscriber to a group
|
@@ -483,7 +483,7 @@ require "mailerlite-ruby"
|
|
483
483
|
campaigns = MailerLite::Campaigns.new
|
484
484
|
|
485
485
|
campaigns.update(
|
486
|
-
campaign_id: 1233455,
|
486
|
+
campaign_id: 1233455,
|
487
487
|
name: "New Campaign Name",
|
488
488
|
language_id: 2,
|
489
489
|
emails: [{
|
@@ -703,7 +703,7 @@ webhooks.create(
|
|
703
703
|
'subscriber.created',
|
704
704
|
'subscriber.updated',
|
705
705
|
'subscriber.unsubscribed'
|
706
|
-
],
|
706
|
+
],
|
707
707
|
url:'https://my-url.com',
|
708
708
|
name: 'Webhook name'
|
709
709
|
)
|
@@ -720,12 +720,12 @@ require "mailerlite-ruby"
|
|
720
720
|
webhooks = MailerLite::Webhooks.new
|
721
721
|
|
722
722
|
webhooks.update(
|
723
|
-
webhook_id: 123456,
|
723
|
+
webhook_id: 123456,
|
724
724
|
events:[
|
725
725
|
'subscriber.created',
|
726
726
|
'subscriber.updated',
|
727
727
|
'subscriber.unsubscribed'
|
728
|
-
],
|
728
|
+
],
|
729
729
|
url:'https://my-url.com',
|
730
730
|
name: 'Webhook name',
|
731
731
|
enabled: false
|
@@ -784,7 +784,7 @@ campaigns.languages()
|
|
784
784
|
# Testing
|
785
785
|
|
786
786
|
```bash
|
787
|
-
bundle i
|
787
|
+
bundle i
|
788
788
|
bundle exec rspec spec/*rspec.rb
|
789
789
|
```
|
790
790
|
|
@@ -794,7 +794,7 @@ The fixtures for the test have been recorded using vcr and are available in the
|
|
794
794
|
# Generate Docs
|
795
795
|
|
796
796
|
```bash
|
797
|
-
bundle i
|
797
|
+
bundle i
|
798
798
|
bundle exec yardoc 'lib/**/*.rb'
|
799
799
|
```
|
800
800
|
|
@@ -54,12 +54,12 @@ module MailerLite
|
|
54
54
|
# @param limit [Integer] the maximum number of subscribers to return
|
55
55
|
# @param page [Integer] the page number of the results to return
|
56
56
|
# @return [HTTP::Response] the response from the API
|
57
|
-
def get_subscribers(group_id:, filter: {}, limit: nil,
|
57
|
+
def get_subscribers(group_id:, filter: {}, limit: nil, cursor: nil, sort: nil)
|
58
58
|
params = {}
|
59
59
|
params['filter[status]'] = filter[:status] if filter.key?(:status)
|
60
60
|
params['limit'] = limit if limit
|
61
61
|
params['sort'] = sort if sort
|
62
|
-
params['
|
62
|
+
params['cursor'] = cursor if cursor
|
63
63
|
client.http.get("#{MAILERLITE_API_URL}/groups/#{group_id}/subscribers", json: params.compact)
|
64
64
|
end
|
65
65
|
|
@@ -18,11 +18,11 @@ module MailerLite
|
|
18
18
|
# @param limit [Integer] the maximum number of subscribers to return
|
19
19
|
# @param page [Integer] the page number of the results to return
|
20
20
|
# @return [HTTP::Response] the response from the API
|
21
|
-
def fetch(filter:, limit: nil,
|
21
|
+
def fetch(filter:, limit: nil, cursor: nil)
|
22
22
|
params = { 'filter[status]' => filter[:status] }
|
23
23
|
|
24
24
|
params['limit'] = limit if limit
|
25
|
-
params['
|
25
|
+
params['cursor'] = cursor if cursor
|
26
26
|
uri = URI("#{MAILERLITE_API_URL}/subscribers")
|
27
27
|
uri.query = URI.encode_www_form(params.compact)
|
28
28
|
client.http.get(uri)
|
data/lib/mailerlite/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailerlite-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Milojević
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
- !ruby/object:Gem::Version
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
|
-
rubygems_version: 3.5.
|
301
|
+
rubygems_version: 3.5.22
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: MailerLite's official Ruby SDK
|