mailerlite-ruby 1.0.6 → 2.1.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/.envrc +2 -0
- data/.github/workflows/main.yml +4 -4
- data/.github/workflows/publish_gem.yml +5 -5
- data/.gitignore +2 -1
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +21 -0
- data/README.md +583 -1
- data/flake.lock +27 -0
- data/flake.nix +25 -0
- data/lefthook.yml +14 -0
- data/lib/mailerlite/api_response.rb +24 -0
- data/lib/mailerlite/automations/automation_emails.rb +57 -0
- data/lib/mailerlite/automations/automation_reports.rb +114 -0
- data/lib/mailerlite/automations/automation_steps.rb +105 -0
- data/lib/mailerlite/automations/automation_templates.rb +34 -0
- data/lib/mailerlite/automations/automation_triggers.rb +62 -0
- data/lib/mailerlite/automations/automations.rb +177 -8
- data/lib/mailerlite/brand_styles/brand_styles.rb +24 -0
- data/lib/mailerlite/campaigns/campaigns.rb +33 -1
- data/lib/mailerlite/client.rb +15 -5
- data/lib/mailerlite/ecommerce/ecommerce.rb +316 -0
- data/lib/mailerlite/emails/emails.rb +306 -0
- data/lib/mailerlite/errors.rb +88 -0
- data/lib/mailerlite/files/files.rb +45 -0
- data/lib/mailerlite/groups/groups.rb +16 -8
- data/lib/mailerlite/params.rb +58 -0
- data/lib/mailerlite/query_params.rb +33 -0
- data/lib/mailerlite/request.rb +24 -0
- data/lib/mailerlite/segments/segments.rb +10 -10
- data/lib/mailerlite/subscribers/subscribers.rb +63 -8
- data/lib/mailerlite/version.rb +1 -1
- data/lib/mailerlite.rb +14 -0
- data/mailerlite-ruby.gemspec +8 -8
- data/spec/api_response_rspec.rb +140 -0
- data/spec/automation_emails_rspec.rb +40 -0
- data/spec/automation_reports_rspec.rb +92 -0
- data/spec/automation_steps_rspec.rb +76 -0
- data/spec/automation_templates_rspec.rb +24 -0
- data/spec/automation_triggers_rspec.rb +48 -0
- data/spec/automations_rspec.rb +143 -0
- data/spec/brand_styles_rspec.rb +49 -0
- data/spec/campaigns_rspec.rb +42 -0
- data/spec/ecommerce_rspec.rb +141 -0
- data/spec/emails_rspec.rb +692 -0
- data/spec/files_rspec.rb +90 -0
- data/spec/fixtures/brand_styles.json +50 -0
- data/spec/fixtures/campaign_simple_editor.json +24 -0
- data/spec/fixtures/email.json +81 -0
- data/spec/fixtures/email_block.json +12 -0
- data/spec/fixtures/email_block_created.json +12 -0
- data/spec/fixtures/email_block_created_rejected.json +15 -0
- data/spec/fixtures/email_block_moved.json +12 -0
- data/spec/fixtures/email_block_updated.json +9 -0
- data/spec/fixtures/email_block_updated_rejected.json +13 -0
- data/spec/fixtures/email_block_validation_invalid.json +5 -0
- data/spec/fixtures/email_etag.json +1 -0
- data/spec/fixtures/email_html.json +1 -0
- data/spec/fixtures/email_settings.json +111 -0
- data/spec/fixtures/email_settings_validation.json +9 -0
- data/spec/fixtures/email_template.json +1 -0
- data/spec/fixtures/email_version.json +1 -0
- data/spec/fixtures/email_versions.json +26 -0
- data/spec/fixtures/files.json +44 -0
- data/spec/groups_rspec.rb +21 -0
- data/spec/params_rspec.rb +126 -0
- data/spec/request_rspec.rb +139 -0
- data/spec/segments_rspec.rb +39 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/subscribers_rspec.rb +57 -0
- data/spec/support/json_fixture.rb +27 -0
- data/spec/support/request_stub.rb +25 -0
- metadata +69 -22
- /data/{renovate.json → .github/renovate.json} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b288c8921cc1a4959ec479db44ccc5c79596d59f0dff01db290d10bee0d8bccc
|
|
4
|
+
data.tar.gz: b53dca35235a46e10fca946eeb8ac59a2f49136eaf3deb45d20b56531ec6ba7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd2c3f01b1bb5741f1972631c079224c063c3ead57739a321482ca8a66e66cbce52907e2d05c8b30a64b6d1392f6999f61ce4b3d0c935a503a24d12212ffc690
|
|
7
|
+
data.tar.gz: 309fecb3615cdd5d2c9b3f0f5d344b024440f6cbde0a36ac7c02754f59052f080a826067d9aab80c65dd43e7efe3ba69f0179eacbd3ebfe67d2857ff69520397
|
data/.envrc
ADDED
data/.github/workflows/main.yml
CHANGED
|
@@ -6,18 +6,18 @@ jobs:
|
|
|
6
6
|
build:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
|
-
- uses: actions/checkout@
|
|
9
|
+
- uses: actions/checkout@v7
|
|
10
10
|
|
|
11
11
|
- name: Set up Ruby
|
|
12
12
|
uses: ruby/setup-ruby@v1
|
|
13
13
|
with:
|
|
14
|
-
ruby-version: 3.
|
|
14
|
+
ruby-version: 3.1
|
|
15
15
|
|
|
16
16
|
- name: Install Bundler
|
|
17
|
-
run: gem install bundler -v 2.
|
|
17
|
+
run: gem install bundler -v 2.5.23
|
|
18
18
|
|
|
19
19
|
- name: Install dependencies
|
|
20
|
-
run: bundle _2.
|
|
20
|
+
run: bundle _2.5.23_ install
|
|
21
21
|
|
|
22
22
|
- name: Run tests
|
|
23
23
|
run: export MAILERLITE_API_TOKEN=dummy_token && bundle exec rspec spec/*rspec.rb
|
|
@@ -9,18 +9,18 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
13
|
|
|
14
14
|
- name: Set up Ruby
|
|
15
|
-
uses:
|
|
15
|
+
uses: ruby/setup-ruby@v1
|
|
16
16
|
with:
|
|
17
|
-
ruby-version: 3.
|
|
17
|
+
ruby-version: 3.1
|
|
18
18
|
|
|
19
19
|
- name: Install Bundler
|
|
20
|
-
run: gem install bundler -v 2.
|
|
20
|
+
run: gem install bundler -v 2.5.23
|
|
21
21
|
|
|
22
22
|
- name: Install dependencies
|
|
23
|
-
run: bundle _2.
|
|
23
|
+
run: bundle _2.5.23_ install
|
|
24
24
|
|
|
25
25
|
- name: Release Gem
|
|
26
26
|
if: contains(github.ref, 'refs/tags/v')
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [Unreleased]
|
|
2
|
+
- Add `Automations#create`, `#update`, `#delete`, `#copy`, `#enable`, `#disable`, `#test`, `#add_subscribers`, `#readd`, `#add_activity_to_group`, `#cancel_activity` and `#skip_activity_delay`
|
|
3
|
+
- Add the `AutomationTriggers`, `AutomationSteps`, `AutomationEmails`, `AutomationTemplates` and `AutomationReports` classes
|
|
4
|
+
- Add `Subscribers#activity_log` and `Groups#import_subscribers`
|
|
5
|
+
- Add the missing documented params to `Subscribers#fetch`, `Subscribers#create`, `Groups#get_subscribers`, `Segments#list`, `Segments#update` and `Automations#get`
|
|
6
|
+
- `Segments#get_subscribers` takes `cursor`. The API ignores `after`, so it always returned the first page
|
|
7
|
+
- `Groups#get_subscribers` and `Segments#list` send their params in the query string, not in a JSON body on a GET
|
|
8
|
+
- `Automations#get_subscriber_activity` takes `filter[:search]`, sent as `filter[search]`. The old `filter[:keyword]` is now sent as `filter[search]` too; the API rejected `filter[keyword]` with a 400
|
|
9
|
+
- `AutomationReports#step_subscribers` and `#trigger_subscribers` send an Array `filter[:id]` as one comma-separated value
|
|
10
|
+
- `Automations#get_subscriber_activity` takes `with_subscribers: true` to include each run's subscriber. It sends `with_subscribers=1` only when true, because the API turns it on for any value
|
|
11
|
+
- Add the `Emails` class for the emails built with the simple editor: get an email, its HTML and its blocks, insert, update, delete, move and validate blocks, update and validate the design settings, save a template, and list, save and restore versions
|
|
12
|
+
- Add `BrandStyles#get` and `Files#list`
|
|
13
|
+
- Add `Campaigns::EDITOR_SIMPLE`, and document `editor` and `template_id` for the emails of `Campaigns#create`
|
|
14
|
+
- Add the optional `idempotency_key` argument to the email writes
|
|
15
|
+
- The new methods return an `HTTP::Response` with `api_error` (a `MailerLite::ApiError` with `status`, `code`, `etag`, `errors` and `api_message`) and `idempotent_replay?`. They do not raise for an API error
|
|
16
|
+
- Document `rejected` in the responses of `Emails#create_block`, `#update_block` and `#validate_block`: the keys that the API dropped from the block
|
|
17
|
+
|
|
18
|
+
## [2.0.0] - 2024-12-11
|
|
19
|
+
- *BREAKING CHANGE* - Please check the README file, dotenv is now optional
|
|
20
|
+
- *BREAKING CHANGE* - Updated the minimal required Ruby version from 2.5 to 3.1
|
|
21
|
+
|
|
1
22
|
## [1.0.6] - 2024-12-06
|
|
2
23
|
- Page parameter to cursor pagination fix
|
|
3
24
|
|