mailerlite-ruby 1.0.4 → 1.0.5
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/.github/workflows/main.yml +9 -3
- data/.github/workflows/publish_gem.yml +11 -0
- data/CHANGELOG.md +3 -0
- data/lib/mailerlite/automations/automations.rb +3 -3
- data/lib/mailerlite/batch/batch.rb +1 -1
- data/lib/mailerlite/campaigns/campaigns.rb +9 -9
- data/lib/mailerlite/client.rb +1 -1
- data/lib/mailerlite/fields/fields.rb +4 -4
- data/lib/mailerlite/forms/forms.rb +6 -6
- data/lib/mailerlite/groups/groups.rb +7 -7
- data/lib/mailerlite/segments/segments.rb +4 -4
- data/lib/mailerlite/subscribers/subscribers.rb +8 -8
- data/lib/mailerlite/timezones/timezones.rb +1 -1
- data/lib/mailerlite/version.rb +1 -1
- data/lib/mailerlite/webhooks/webhooks.rb +5 -5
- data/mailerlite-ruby.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 102aeffa28b4e834a28a6e03482f93bbbcc051bae9fc460e4211556c747471d5
|
4
|
+
data.tar.gz: cdb4915ff453305c4d1c839955589c0139fc38271aa7b65c1f1581ec3cb7714b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d992ce5751fb5509c94260284c943d35a4ce4ce39557e796b8930064886a9e57cf9e3956008d69f8b93650c03b7ef7809a6e3e6f175b06645dd0cecac990f895
|
7
|
+
data.tar.gz: 54b4d12eafd3e6f2816dcfed36374a9d85d45562a1caf482fe67351150024fcc1631befa6050671009ef2031c451e9219d957a69e2530993db999caa231b7e1a
|
data/.github/workflows/main.yml
CHANGED
@@ -6,12 +6,18 @@ jobs:
|
|
6
6
|
build:
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
steps:
|
9
|
-
- uses: actions/checkout@
|
9
|
+
- uses: actions/checkout@v4
|
10
|
+
|
10
11
|
- name: Set up Ruby
|
11
12
|
uses: ruby/setup-ruby@v1
|
12
13
|
with:
|
13
14
|
ruby-version: 3.0
|
14
|
-
|
15
|
-
|
15
|
+
|
16
|
+
- name: Install Bundler
|
17
|
+
run: gem install bundler -v 2.4.22
|
18
|
+
|
19
|
+
- name: Install dependencies
|
20
|
+
run: bundle _2.4.22_ install
|
21
|
+
|
16
22
|
- name: Run tests
|
17
23
|
run: export MAILERLITE_API_TOKEN=dummy_token && bundle exec rspec spec/*rspec.rb
|
@@ -11,6 +11,17 @@ jobs:
|
|
11
11
|
steps:
|
12
12
|
- uses: actions/checkout@v4
|
13
13
|
|
14
|
+
- name: Set up Ruby
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: 3.0
|
18
|
+
|
19
|
+
- name: Install Bundler
|
20
|
+
run: gem install bundler -v 2.4.22
|
21
|
+
|
22
|
+
- name: Install dependencies
|
23
|
+
run: bundle _2.4.22_ install
|
24
|
+
|
14
25
|
- name: Release Gem
|
15
26
|
if: contains(github.ref, 'refs/tags/v')
|
16
27
|
uses: cadwallion/publish-rubygems-action@master
|
data/CHANGELOG.md
CHANGED
@@ -25,7 +25,7 @@ module MailerLite
|
|
25
25
|
params['filter[group]'] = filter[:group] if filter.key?(:group)
|
26
26
|
params['limit'] = limit if limit
|
27
27
|
params['page'] = page if page
|
28
|
-
uri = URI("#{
|
28
|
+
uri = URI("#{MAILERLITE_API_URL}/automations")
|
29
29
|
uri.query = URI.encode_www_form(params.compact)
|
30
30
|
client.http.get(uri)
|
31
31
|
end
|
@@ -35,7 +35,7 @@ module MailerLite
|
|
35
35
|
# @param automation_id [String] the ID of the Automation to fetch
|
36
36
|
# @return [HTTP::Response] the response from the API
|
37
37
|
def fetch(automation_id)
|
38
|
-
client.http.get("#{
|
38
|
+
client.http.get("#{MAILERLITE_API_URL}/automations/#{automation_id}")
|
39
39
|
end
|
40
40
|
|
41
41
|
# get_subscriber_activity the subscriber activity for specified Automation
|
@@ -54,7 +54,7 @@ module MailerLite
|
|
54
54
|
params['filter[keyword]'] = filter[:keyword] if filter.key?(:keyword)
|
55
55
|
params['page'] = page if page
|
56
56
|
params['limit'] = limit if limit
|
57
|
-
uri = URI("#{
|
57
|
+
uri = URI("#{MAILERLITE_API_URL}/automations/#{automation_id}/activity")
|
58
58
|
uri.query = URI.encode_www_form(params.compact)
|
59
59
|
client.http.get(uri)
|
60
60
|
end
|
@@ -18,7 +18,7 @@ module MailerLite
|
|
18
18
|
# @return [HTTP::Response] the response from the API
|
19
19
|
def request(requests:)
|
20
20
|
params = { requests: requests }
|
21
|
-
client.http.post("#{
|
21
|
+
client.http.post("#{MAILERLITE_API_URL}/batch", body: params.to_json)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -24,7 +24,7 @@ module MailerLite
|
|
24
24
|
params['filter[type]'] = filter[:type] if filter.key?(:type)
|
25
25
|
params['limit'] = limit if limit
|
26
26
|
params['page'] = page if page
|
27
|
-
uri = URI("#{
|
27
|
+
uri = URI("#{MAILERLITE_API_URL}/campaigns")
|
28
28
|
uri.query = URI.encode_www_form(params.compact)
|
29
29
|
client.http.get(uri)
|
30
30
|
end
|
@@ -78,7 +78,7 @@ module MailerLite
|
|
78
78
|
}
|
79
79
|
end
|
80
80
|
|
81
|
-
client.http.post("#{
|
81
|
+
client.http.post("#{MAILERLITE_API_URL}/campaigns", body: params.compact.to_json)
|
82
82
|
end
|
83
83
|
|
84
84
|
# Update a new campaign with the specified details.
|
@@ -132,7 +132,7 @@ module MailerLite
|
|
132
132
|
|
133
133
|
end
|
134
134
|
|
135
|
-
client.http.put("#{
|
135
|
+
client.http.put("#{MAILERLITE_API_URL}/campaigns/#{campaign_id}", body: params.compact.to_json)
|
136
136
|
end
|
137
137
|
|
138
138
|
# Schedules the specified campaign.
|
@@ -160,7 +160,7 @@ module MailerLite
|
|
160
160
|
params['resend']['minutes'] = resend[:minutes] if resend&.key?(:minutes)
|
161
161
|
params['resend']['timezone_id'] = resend[:timezone_id] if resend&.key?(:timezone_id)
|
162
162
|
|
163
|
-
client.http.post("#{
|
163
|
+
client.http.post("#{MAILERLITE_API_URL}/campaigns/#{campaign_id}/schedule", body: params.compact.to_json)
|
164
164
|
end
|
165
165
|
|
166
166
|
# Returns the details of the specified Campaigns
|
@@ -168,7 +168,7 @@ module MailerLite
|
|
168
168
|
# @param campaign_id [String] the ID of the campaign to fetch
|
169
169
|
# @return [HTTP::Response] the response from the API
|
170
170
|
def fetch(campaign_id)
|
171
|
-
client.http.get("#{
|
171
|
+
client.http.get("#{MAILERLITE_API_URL}/campaigns/#{campaign_id}")
|
172
172
|
end
|
173
173
|
|
174
174
|
# Cancels the specified campaign.
|
@@ -176,7 +176,7 @@ module MailerLite
|
|
176
176
|
# @param campaign_id [String] the ID of the campaign to delete
|
177
177
|
# @return [HTTP::Response] the response from the API
|
178
178
|
def cancel(campaign_id)
|
179
|
-
client.http.post("#{
|
179
|
+
client.http.post("#{MAILERLITE_API_URL}/campaigns/#{campaign_id}/cancel")
|
180
180
|
end
|
181
181
|
|
182
182
|
# Deletes the specified campaign.
|
@@ -184,7 +184,7 @@ module MailerLite
|
|
184
184
|
# @param campaign_id [String] the ID of the campaign to delete
|
185
185
|
# @return [HTTP::Response] the response from the API
|
186
186
|
def delete(campaign_id)
|
187
|
-
client.http.delete("#{
|
187
|
+
client.http.delete("#{MAILERLITE_API_URL}/campaigns/#{campaign_id}")
|
188
188
|
end
|
189
189
|
|
190
190
|
# activity the subscriber activity for specified campaign
|
@@ -203,14 +203,14 @@ module MailerLite
|
|
203
203
|
params['page'] = page if page
|
204
204
|
params['limit'] = limit if limit
|
205
205
|
params['sort'] = sort if sort
|
206
|
-
client.http.post("#{
|
206
|
+
client.http.post("#{MAILERLITE_API_URL}/campaigns/#{campaign_id}/reports/subscriber-activity", body: params.compact.to_json)
|
207
207
|
end
|
208
208
|
|
209
209
|
# Get a list of all campaign languages available
|
210
210
|
#
|
211
211
|
# @return [HTTP::Response] the response from the API
|
212
212
|
def languages
|
213
|
-
client.http.get("#{
|
213
|
+
client.http.get("#{MAILERLITE_API_URL}/campaigns/languages")
|
214
214
|
end
|
215
215
|
end
|
216
216
|
end
|
data/lib/mailerlite/client.rb
CHANGED
@@ -25,7 +25,7 @@ module MailerLite
|
|
25
25
|
params['sort'] = sort if sort
|
26
26
|
params['limit'] = limit if limit
|
27
27
|
params['page'] = page if page
|
28
|
-
uri = URI("#{
|
28
|
+
uri = URI("#{MAILERLITE_API_URL}/fields")
|
29
29
|
uri.query = URI.encode_www_form(params.compact)
|
30
30
|
client.http.get(uri)
|
31
31
|
end
|
@@ -37,7 +37,7 @@ module MailerLite
|
|
37
37
|
# @return [HTTP::Response] the response from the API
|
38
38
|
def create(type:, name:)
|
39
39
|
params = { 'name' => name, 'type' => type }
|
40
|
-
client.http.post("#{
|
40
|
+
client.http.post("#{MAILERLITE_API_URL}/fields", json: params.compact)
|
41
41
|
end
|
42
42
|
|
43
43
|
# Update the specified Field
|
@@ -47,7 +47,7 @@ module MailerLite
|
|
47
47
|
# @return [HTTP::Response] the response from the API
|
48
48
|
def update(field_id:, name:)
|
49
49
|
params = { 'name' => name }
|
50
|
-
client.http.put("#{
|
50
|
+
client.http.put("#{MAILERLITE_API_URL}/fields/#{field_id}", json: params.compact)
|
51
51
|
end
|
52
52
|
|
53
53
|
# Deletes the specified Field.
|
@@ -55,7 +55,7 @@ module MailerLite
|
|
55
55
|
# @param field_id [String] the ID of the Field to delete
|
56
56
|
# @return [HTTP::Response] the response from the API
|
57
57
|
def delete(field_id)
|
58
|
-
client.http.delete("#{
|
58
|
+
client.http.delete("#{MAILERLITE_API_URL}/fields/#{field_id}")
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -24,7 +24,7 @@ module MailerLite
|
|
24
24
|
params['limit'] = limit if limit
|
25
25
|
params['sort'] = sort if sort
|
26
26
|
params['page'] = page if page
|
27
|
-
uri = URI("#{
|
27
|
+
uri = URI("#{MAILERLITE_API_URL}/forms/#{type}")
|
28
28
|
uri.query = URI.encode_www_form(params.compact)
|
29
29
|
client.http.get(uri)
|
30
30
|
end
|
@@ -34,7 +34,7 @@ module MailerLite
|
|
34
34
|
# @param form_id [String] the ID of the forms to fetch
|
35
35
|
# @return [HTTP::Response] the response from the API
|
36
36
|
def fetch(form_id)
|
37
|
-
client.http.get("#{
|
37
|
+
client.http.get("#{MAILERLITE_API_URL}/forms/#{form_id}")
|
38
38
|
end
|
39
39
|
|
40
40
|
# Returns the subscribers who signed up to a specific form
|
@@ -42,7 +42,7 @@ module MailerLite
|
|
42
42
|
# @param form_id [String] the ID of the forms to fetch
|
43
43
|
# @return [HTTP::Response] the response from the API
|
44
44
|
def fetch_subscribers(form_id)
|
45
|
-
client.http.get("#{
|
45
|
+
client.http.get("#{MAILERLITE_API_URL}/forms/#{form_id}/subscribers")
|
46
46
|
end
|
47
47
|
|
48
48
|
# Update the specified Forms
|
@@ -52,14 +52,14 @@ module MailerLite
|
|
52
52
|
# @return [HTTP::Response] the response from the API
|
53
53
|
def update(form_id:, name:)
|
54
54
|
params = { 'name' => name }
|
55
|
-
client.http.put("#{
|
55
|
+
client.http.put("#{MAILERLITE_API_URL}/forms/#{form_id}", json: params.compact)
|
56
56
|
end
|
57
57
|
|
58
58
|
# Returns the total number of Forms in the MailerLite account.
|
59
59
|
#
|
60
60
|
# @return [HTTP::Response] the response from the API
|
61
61
|
def fetch_count
|
62
|
-
client.http.get("#{
|
62
|
+
client.http.get("#{MAILERLITE_API_URL}/forms/?limit=0")
|
63
63
|
end
|
64
64
|
|
65
65
|
# Deletes the specified forms.
|
@@ -67,7 +67,7 @@ module MailerLite
|
|
67
67
|
# @param form_id [String] the ID of the forms to delete
|
68
68
|
# @return [HTTP::Response] the response from the API
|
69
69
|
def delete(form_id)
|
70
|
-
client.http.delete("#{
|
70
|
+
client.http.delete("#{MAILERLITE_API_URL}/forms/#{form_id}")
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
@@ -24,7 +24,7 @@ module MailerLite
|
|
24
24
|
params['limit'] = limit if limit
|
25
25
|
params['sort'] = sort if sort
|
26
26
|
params['page'] = page if page
|
27
|
-
uri = URI("#{
|
27
|
+
uri = URI("#{MAILERLITE_API_URL}/groups")
|
28
28
|
uri.query = URI.encode_www_form(params.compact)
|
29
29
|
client.http.get(uri)
|
30
30
|
end
|
@@ -35,7 +35,7 @@ module MailerLite
|
|
35
35
|
# @return [HTTP::Response] the response from the API
|
36
36
|
def create(name:)
|
37
37
|
params = { 'name' => name }
|
38
|
-
client.http.post("#{
|
38
|
+
client.http.post("#{MAILERLITE_API_URL}/groups", json: params.compact)
|
39
39
|
end
|
40
40
|
|
41
41
|
# Update the specified Group
|
@@ -45,7 +45,7 @@ module MailerLite
|
|
45
45
|
# @return [HTTP::Response] the response from the API
|
46
46
|
def update(group_id:, name:)
|
47
47
|
params = { 'name' => name }
|
48
|
-
client.http.put("#{
|
48
|
+
client.http.put("#{MAILERLITE_API_URL}/groups/#{group_id}", json: params.compact)
|
49
49
|
end
|
50
50
|
|
51
51
|
# Get Subscribers assigned to the specified group.
|
@@ -60,7 +60,7 @@ module MailerLite
|
|
60
60
|
params['limit'] = limit if limit
|
61
61
|
params['sort'] = sort if sort
|
62
62
|
params['page'] = page if page
|
63
|
-
client.http.get("#{
|
63
|
+
client.http.get("#{MAILERLITE_API_URL}/groups/#{group_id}/subscribers", json: params.compact)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Assign Subscriber to the specified group.
|
@@ -68,7 +68,7 @@ module MailerLite
|
|
68
68
|
# @param subscriber [Integer] The id of existing subscriber belonging to the account
|
69
69
|
# @return [HTTP::Response] the response from the API
|
70
70
|
def assign_subscriber(group_id:, subscriber:)
|
71
|
-
client.http.post("#{
|
71
|
+
client.http.post("#{MAILERLITE_API_URL}/subscribers/#{subscriber}/groups/#{group_id}")
|
72
72
|
end
|
73
73
|
|
74
74
|
# Unassign Subscriber to the specified group.
|
@@ -76,7 +76,7 @@ module MailerLite
|
|
76
76
|
# @param subscriber [Integer] The id of existing subscriber belonging to the account
|
77
77
|
# @return [HTTP::Response] the response from the API
|
78
78
|
def unassign_subscriber(group_id:, subscriber:)
|
79
|
-
client.http.delete("#{
|
79
|
+
client.http.delete("#{MAILERLITE_API_URL}/subscribers/#{subscriber}/groups/#{group_id}")
|
80
80
|
end
|
81
81
|
|
82
82
|
# Deletes the specified Groups.
|
@@ -84,7 +84,7 @@ module MailerLite
|
|
84
84
|
# @param group_id [String] the ID of the Groups to delete
|
85
85
|
# @return [HTTP::Response] the response from the API
|
86
86
|
def delete(group_id)
|
87
|
-
client.http.delete("#{
|
87
|
+
client.http.delete("#{MAILERLITE_API_URL}/groups/#{group_id}")
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -22,7 +22,7 @@ module MailerLite
|
|
22
22
|
params['limit'] = limit if limit
|
23
23
|
params['page'] = page if page
|
24
24
|
|
25
|
-
client.http.get("#{
|
25
|
+
client.http.get("#{MAILERLITE_API_URL}/segments", json: params.compact)
|
26
26
|
end
|
27
27
|
|
28
28
|
# Update the specified Segment
|
@@ -32,7 +32,7 @@ module MailerLite
|
|
32
32
|
# @return [HTTP::Response] the response from the API
|
33
33
|
def update(segment_id:, name:)
|
34
34
|
params = { 'name' => name }
|
35
|
-
client.http.put("#{
|
35
|
+
client.http.put("#{MAILERLITE_API_URL}/segments/#{segment_id}", json: params.compact)
|
36
36
|
end
|
37
37
|
|
38
38
|
# Get Subscribers assigned to the specified Segment.
|
@@ -46,7 +46,7 @@ module MailerLite
|
|
46
46
|
params['filter[status]'] = filter[:status] if filter.key?(:status)
|
47
47
|
params['limit'] = limit if limit
|
48
48
|
params['after'] = after if after
|
49
|
-
uri = URI("#{
|
49
|
+
uri = URI("#{MAILERLITE_API_URL}/segments/#{segment_id}/subscribers")
|
50
50
|
uri.query = URI.encode_www_form(params.compact)
|
51
51
|
client.http.get(uri)
|
52
52
|
end
|
@@ -56,7 +56,7 @@ module MailerLite
|
|
56
56
|
# @param segment_id [String] the ID of the Segments to delete
|
57
57
|
# @return [HTTP::Response] the response from the API
|
58
58
|
def delete(segment_id)
|
59
|
-
client.http.delete("#{
|
59
|
+
client.http.delete("#{MAILERLITE_API_URL}/segments/#{segment_id}")
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -23,7 +23,7 @@ module MailerLite
|
|
23
23
|
|
24
24
|
params['limit'] = limit if limit
|
25
25
|
params['page'] = page if page
|
26
|
-
uri = URI("#{
|
26
|
+
uri = URI("#{MAILERLITE_API_URL}/subscribers")
|
27
27
|
uri.query = URI.encode_www_form(params.compact)
|
28
28
|
client.http.get(uri)
|
29
29
|
end
|
@@ -52,7 +52,7 @@ module MailerLite
|
|
52
52
|
params['optin_ip'] = optin_ip if optin_ip
|
53
53
|
params['unsubscribed_at'] = unsubscribed_at if unsubscribed_at
|
54
54
|
|
55
|
-
client.http.post("#{
|
55
|
+
client.http.post("#{MAILERLITE_API_URL}/subscribers", json: params.compact)
|
56
56
|
end
|
57
57
|
|
58
58
|
# Updates an existing subscriber with the specified details.
|
@@ -81,7 +81,7 @@ module MailerLite
|
|
81
81
|
params['optin_ip'] = optin_ip if optin_ip
|
82
82
|
params['unsubscribed_at'] = unsubscribed_at if unsubscribed_at
|
83
83
|
|
84
|
-
client.http.put("#{
|
84
|
+
client.http.put("#{MAILERLITE_API_URL}/subscribers/#{subscriber_id}", json: params.compact)
|
85
85
|
end
|
86
86
|
|
87
87
|
# Returns the details of the specified subscribers
|
@@ -89,7 +89,7 @@ module MailerLite
|
|
89
89
|
# @param subscriber_id [String] the ID of the subscriber to get
|
90
90
|
# @return [HTTP::Response] the response from the API
|
91
91
|
def get(subscriber_id)
|
92
|
-
client.http.get("#{
|
92
|
+
client.http.get("#{MAILERLITE_API_URL}/subscribers/#{subscriber_id}")
|
93
93
|
end
|
94
94
|
|
95
95
|
# Returns the details of the specified subscribers
|
@@ -97,14 +97,14 @@ module MailerLite
|
|
97
97
|
# @param import_id [String] the ID of the import to fetch report
|
98
98
|
# @return [HTTP::Response] the response from the API
|
99
99
|
def get_single_import(import_id)
|
100
|
-
client.http.get("#{
|
100
|
+
client.http.get("#{MAILERLITE_API_URL}/subscribers/import/#{import_id}")
|
101
101
|
end
|
102
102
|
|
103
103
|
# Returns the total number of subscribers in the MailerLite account.
|
104
104
|
#
|
105
105
|
# @return [HTTP::Response] the response from the API
|
106
106
|
def fetch_count
|
107
|
-
client.http.get("#{
|
107
|
+
client.http.get("#{MAILERLITE_API_URL}/subscribers/?limit=0")
|
108
108
|
end
|
109
109
|
|
110
110
|
# Deletes the specified subscriber.
|
@@ -112,7 +112,7 @@ module MailerLite
|
|
112
112
|
# @param subscriber_id [String] the ID of the subscriber to delete
|
113
113
|
# @return [HTTP::Response] the response from the API
|
114
114
|
def delete(subscriber_id)
|
115
|
-
client.http.delete("#{
|
115
|
+
client.http.delete("#{MAILERLITE_API_URL}/subscribers/#{subscriber_id}")
|
116
116
|
end
|
117
117
|
|
118
118
|
# Forgets the specified subscriber.
|
@@ -120,7 +120,7 @@ module MailerLite
|
|
120
120
|
# @param subscriber_id [String] the ID of the subscriber to forget
|
121
121
|
# @return [HTTP::Response] the response from the API
|
122
122
|
def forget(subscriber_id)
|
123
|
-
client.http.post("#{
|
123
|
+
client.http.post("#{MAILERLITE_API_URL}/subscribers/#{subscriber_id}/forget")
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
data/lib/mailerlite/version.rb
CHANGED
@@ -16,7 +16,7 @@ module MailerLite
|
|
16
16
|
#
|
17
17
|
# @return [HTTP::Response] the response from the API
|
18
18
|
def list
|
19
|
-
client.http.get("#{
|
19
|
+
client.http.get("#{MAILERLITE_API_URL}/webhooks")
|
20
20
|
end
|
21
21
|
|
22
22
|
# Returns the details of the specified webhooks
|
@@ -24,7 +24,7 @@ module MailerLite
|
|
24
24
|
# @param webhook_id [String] the ID of the webhooks to fetch
|
25
25
|
# @return [HTTP::Response] the response from the API
|
26
26
|
def get(webhook_id)
|
27
|
-
client.http.get("#{
|
27
|
+
client.http.get("#{MAILERLITE_API_URL}/webhooks/#{webhook_id}")
|
28
28
|
end
|
29
29
|
|
30
30
|
# Create a Webhook
|
@@ -36,7 +36,7 @@ module MailerLite
|
|
36
36
|
def create(events:, url:, name: nil)
|
37
37
|
params = { 'events' => events, 'url' => url }
|
38
38
|
params['name'] = name if name
|
39
|
-
client.http.post("#{
|
39
|
+
client.http.post("#{MAILERLITE_API_URL}/webhooks", json: params.compact)
|
40
40
|
end
|
41
41
|
|
42
42
|
# Update the specified Webhook
|
@@ -53,7 +53,7 @@ module MailerLite
|
|
53
53
|
params['name'] = name if name
|
54
54
|
params['url'] = url if url
|
55
55
|
params['enabled'] = enabled if enabled
|
56
|
-
client.http.put("#{
|
56
|
+
client.http.put("#{MAILERLITE_API_URL}/webhooks/#{webhook_id}", json: params.compact)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Deletes the specified Webhook.
|
@@ -61,7 +61,7 @@ module MailerLite
|
|
61
61
|
# @param webhook_id [String] the ID of the Webhook to delete
|
62
62
|
# @return [HTTP::Response] the response from the API
|
63
63
|
def delete(webhook_id)
|
64
|
-
client.http.delete("#{
|
64
|
+
client.http.delete("#{MAILERLITE_API_URL}/webhooks/#{webhook_id}")
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data/mailerlite-ruby.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_dependency 'dotenv', '~> 2.7'
|
34
34
|
spec.add_dependency 'http', '~> 5.0'
|
35
35
|
spec.add_dependency 'json', '~> 2.5'
|
36
|
-
spec.add_dependency 'uri', '~> 0.
|
36
|
+
spec.add_dependency 'uri', '~> 0.13.0'
|
37
37
|
spec.add_development_dependency 'rspec'
|
38
38
|
spec.add_development_dependency 'simplecov'
|
39
39
|
spec.add_development_dependency 'vcr'
|
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.5
|
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:
|
12
|
+
date: 2024-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -101,14 +101,14 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.
|
104
|
+
version: 0.13.0
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.
|
111
|
+
version: 0.13.0
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: rspec
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|
301
|
+
rubygems_version: 3.5.3
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: MailerLite's official Ruby SDK
|