mailerlite-ruby 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.env.example +1 -0
  3. data/.github/workflows/main.yml +17 -0
  4. data/.github/workflows/publish_gem.yml +21 -0
  5. data/.gitignore +60 -0
  6. data/.rspec +1 -0
  7. data/.rubocop.yml +36 -0
  8. data/CHANGELOG.md +1 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +801 -0
  12. data/Rakefile +8 -0
  13. data/bin/console +8 -0
  14. data/bin/setup +8 -0
  15. data/fixtures/automations/fetch.yml +61 -0
  16. data/fixtures/automations/get.yml +68 -0
  17. data/fixtures/automations/get_subscriber_activity.yml +71 -0
  18. data/fixtures/batch/request.yml +59 -0
  19. data/fixtures/campaigns/activity.yml +64 -0
  20. data/fixtures/campaigns/create.yml +65 -0
  21. data/fixtures/campaigns/delete.yml +53 -0
  22. data/fixtures/campaigns/fetch.yml +64 -0
  23. data/fixtures/campaigns/get.yml +68 -0
  24. data/fixtures/campaigns/languages.yml +60 -0
  25. data/fixtures/campaigns/schedule.yml +160 -0
  26. data/fixtures/campaigns/update.yml +159 -0
  27. data/fixtures/fields/create.yml +57 -0
  28. data/fixtures/fields/delete.yml +53 -0
  29. data/fixtures/fields/get.yml +60 -0
  30. data/fixtures/fields/update.yml +57 -0
  31. data/fixtures/forms/delete.yml +53 -0
  32. data/fixtures/forms/fetch.yml +60 -0
  33. data/fixtures/forms/fetch_subscribers.yml +59 -0
  34. data/fixtures/forms/list.yml +62 -0
  35. data/fixtures/forms/update.yml +60 -0
  36. data/fixtures/groups/assign_subscriber.yml +58 -0
  37. data/fixtures/groups/create.yml +58 -0
  38. data/fixtures/groups/delete.yml +53 -0
  39. data/fixtures/groups/get.yml +63 -0
  40. data/fixtures/groups/get_subscribers.yml +62 -0
  41. data/fixtures/groups/unassign_subscriber.yml +53 -0
  42. data/fixtures/groups/update.yml +58 -0
  43. data/fixtures/segments/delete.yml +53 -0
  44. data/fixtures/segments/get_subscribers.yml +61 -0
  45. data/fixtures/segments/list.yml +60 -0
  46. data/fixtures/segments/update.yml +58 -0
  47. data/fixtures/subscribers/create.yml +57 -0
  48. data/fixtures/subscribers/delete.yml +51 -0
  49. data/fixtures/subscribers/fetch.yml +68 -0
  50. data/fixtures/subscribers/fetch_count.yml +55 -0
  51. data/fixtures/subscribers/get.yml +62 -0
  52. data/fixtures/timezones/list.yml +575 -0
  53. data/fixtures/webhooks/create.yml +58 -0
  54. data/fixtures/webhooks/delete.yml +53 -0
  55. data/fixtures/webhooks/get.yml +58 -0
  56. data/fixtures/webhooks/list.yml +61 -0
  57. data/fixtures/webhooks/update.yml +58 -0
  58. data/lib/mailerlite/automations/automations.rb +62 -0
  59. data/lib/mailerlite/batch/batch.rb +24 -0
  60. data/lib/mailerlite/campaigns/campaigns.rb +216 -0
  61. data/lib/mailerlite/client.rb +35 -0
  62. data/lib/mailerlite/fields/fields.rb +61 -0
  63. data/lib/mailerlite/forms/forms.rb +73 -0
  64. data/lib/mailerlite/groups/groups.rb +90 -0
  65. data/lib/mailerlite/segments/segments.rb +62 -0
  66. data/lib/mailerlite/subscribers/subscribers.rb +116 -0
  67. data/lib/mailerlite/timezones/timezones.rb +22 -0
  68. data/lib/mailerlite/version.rb +5 -0
  69. data/lib/mailerlite/webhooks/webhooks.rb +67 -0
  70. data/lib/mailerlite-ruby.rb +3 -0
  71. data/lib/mailerlite.rb +13 -0
  72. data/mailerlite-ruby.gemspec +42 -0
  73. data/renovate.json +5 -0
  74. data/spec/automations_rspec.rb +63 -0
  75. data/spec/batches_rspec.rb +41 -0
  76. data/spec/campaigns_rspec.rb +155 -0
  77. data/spec/fields_rspec.rb +70 -0
  78. data/spec/forms_rspec.rb +81 -0
  79. data/spec/groups_rspec.rb +97 -0
  80. data/spec/segments_rspec.rb +70 -0
  81. data/spec/spec_helper.rb +101 -0
  82. data/spec/subscribers_rspec.rb +84 -0
  83. data/spec/timezones_rspec.rb +36 -0
  84. data/spec/webhooks_rspec.rb +86 -0
  85. metadata +303 -0
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rubocop/rake_task'
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
data/bin/console ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require_relative '../lib/mailerlite/version'
6
+
7
+ require 'irb'
8
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,61 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://connect.mailerlite.com/api/automations/75040845299975641
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Thu, 22 Dec 2022 21:06:28 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '119'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77dbd24dffd7de57-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":{"id":"75040845299975641","name":"Test Automation","enabled":true,"trigger_data":{"track_ecommerce":false,"repeatable":false,"valid":true},"steps":[{"id":"75040874340287587","type":"action","parent_id":null,"complete":true,"broken":false,"created_at":"2022-12-20
56
+ 19:29:14","updated_at":"2022-12-20 19:29:31","action_type":"update_custom_field","field_id":"5","field":{"id":"5","name":"City","key":"city","type":"text"},"date_operation":null,"value":"Lajpcig","description":"Update
57
+ custom field to \"Lajpcig\""}],"triggers":[{"id":"75040865662273074","type":"subscriber_joins_group","group_id":"75011449370445335","group":{"id":"75011449370445335","name":"My
58
+ Group","url":"https:\/\/dashboard.mailerlite.com\/subscribers?rules=W1t7Im9wZXJhdG9yIjoiaW5fYW55IiwiY29uZGl0aW9uIjoiZ3JvdXBzIiwiYXJncyI6WyJncm91cHMiLFsiNzUwMTE0NDkzNzA0NDUzMzUiXV19XV0%3D"},"exclude_group_ids":[],"excluded_groups":[],"broken":false}],"complete":true,"broken":false,"warnings":[],"stats":{"completed_subscribers_count":0,"subscribers_in_queue_count":0,"bounce_rate":{"float":0,"string":"0%"},"click_to_open_rate":{"float":0,"string":"0%"},"sent":0,"opens_count":0,"unique_opens_count":null,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":null,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"}},"created_at":"2022-12-20
59
+ 19:28:46","has_banned_content":false,"qualified_subscribers_count":1}}'
60
+ recorded_at: Thu, 22 Dec 2022 21:06:26 GMT
61
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://connect.mailerlite.com/api/automations
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Fri, 23 Dec 2022 12:28:38 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '119'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77e1191ea97dde43-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":"75040845299975641","name":"Test Automation","enabled":true,"trigger_data":{"track_ecommerce":false,"repeatable":false,"valid":true},"steps":[{"id":"75040874340287587","type":"action","parent_id":null,"complete":true,"broken":false,"created_at":"2022-12-20
56
+ 19:29:14","updated_at":"2022-12-20 19:29:31","action_type":"update_custom_field","field_id":"5","field":{"id":"5","name":"City","key":"city","type":"text"},"date_operation":null,"value":"Lajpcig","description":"Update
57
+ custom field to \"Lajpcig\""}],"triggers":[{"id":"75040865662273074","type":"subscriber_joins_group","group_id":"75011449370445335","group":{"id":"75011449370445335","name":"My
58
+ Group","url":"https:\/\/dashboard.mailerlite.com\/subscribers?rules=W1t7Im9wZXJhdG9yIjoiaW5fYW55IiwiY29uZGl0aW9uIjoiZ3JvdXBzIiwiYXJncyI6WyJncm91cHMiLFsiNzUwMTE0NDkzNzA0NDUzMzUiXV19XV0%3D"},"exclude_group_ids":[],"excluded_groups":[],"broken":false}],"complete":true,"broken":false,"warnings":[],"emails_count":0,"first_email_screenshot_url":null,"stats":{"completed_subscribers_count":3,"subscribers_in_queue_count":0,"bounce_rate":{"float":0,"string":"0%"},"click_to_open_rate":{"float":0,"string":"0%"},"sent":0,"opens_count":0,"unique_opens_count":null,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":null,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"}},"created_at":"2022-12-20
59
+ 19:28:46","has_banned_content":false,"qualified_subscribers_count":1},{"id":"75230383331869729","name":"test
60
+ automation 2","enabled":true,"trigger_data":{"track_ecommerce":false,"repeatable":true,"valid":true},"steps":[{"id":"75230414735672857","type":"action","parent_id":null,"complete":true,"broken":false,"created_at":"2022-12-22
61
+ 21:41:54","updated_at":"2022-12-22 21:42:06","action_type":"copy_to_group","group_id":"75138838590129612","group_name":"SMmwGofyQP","description":"Copy
62
+ to a group"}],"triggers":[{"id":"75230409252668552","type":"subscriber_joins_group","group_id":"75011449370445335","group":{"id":"75011449370445335","name":"My
63
+ Group","url":"https:\/\/dashboard.mailerlite.com\/subscribers?rules=W1t7Im9wZXJhdG9yIjoiaW5fYW55IiwiY29uZGl0aW9uIjoiZ3JvdXBzIiwiYXJncyI6WyJncm91cHMiLFsiNzUwMTE0NDkzNzA0NDUzMzUiXV19XV0%3D"},"exclude_group_ids":[],"excluded_groups":[],"broken":false}],"complete":true,"broken":false,"warnings":[],"emails_count":0,"first_email_screenshot_url":null,"stats":{"completed_subscribers_count":4,"subscribers_in_queue_count":0,"bounce_rate":{"float":0,"string":"0%"},"click_to_open_rate":{"float":0,"string":"0%"},"sent":0,"opens_count":0,"unique_opens_count":null,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":null,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"}},"created_at":"2022-12-22
64
+ 21:41:24","has_banned_content":false,"qualified_subscribers_count":0}],"links":{"first":"https:\/\/connect.mailerlite.com\/api\/automations?page=1","last":"https:\/\/connect.mailerlite.com\/api\/automations?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo;
65
+ Previous","active":false},{"url":"https:\/\/connect.mailerlite.com\/api\/automations?page=1","label":"1","active":true},{"url":null,"label":"Next
66
+ &raquo;","active":false}],"path":"https:\/\/connect.mailerlite.com\/api\/automations","per_page":10,"to":2,"total":2,"total_unfiltered":2}}'
67
+ recorded_at: Fri, 23 Dec 2022 12:28:35 GMT
68
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://connect.mailerlite.com/api/automations/75040845299975641/activity?filter%5Bstatus%5D=completed
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Fri, 23 Dec 2022 12:29:52 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '119'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77e11aee5eabd1e8-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":"75230485820736830","status":"Completed","date":"2022-12-22
56
+ 21:43:02","reason":null,"reason_description":"","subscriber":{"id":"73931277474989872","email":"sdk@mailerlite.com"},"stepRuns":[{"id":"75230485910914375","step_id":"75040874340287587","description":"Update
57
+ custom field to \"Lajpcig\"","scheduled_for":null}],"currentStep":{"id":"75040874340287587","type":"action","parent_id":null,"complete":true,"broken":false,"created_at":"2022-12-20
58
+ 19:29:14","updated_at":"2022-12-20 19:29:31","action_type":"update_custom_field","field_id":"5","field":{"id":"5","name":"City","key":"city","type":"text"},"date_operation":null,"value":"Lajpcig","description":"Update
59
+ custom field to \"Lajpcig\""}},{"id":"75230486001091919","status":"Completed","date":"2022-12-22
60
+ 21:43:02","reason":null,"reason_description":"","subscriber":{"id":"75009808377317072","email":"first@email.com"},"stepRuns":[{"id":"75230486081832277","step_id":"75040874340287587","description":"Update
61
+ custom field to \"Lajpcig\"","scheduled_for":null}],"currentStep":{"id":"75040874340287587","type":"action","parent_id":null,"complete":true,"broken":false,"created_at":"2022-12-20
62
+ 19:29:14","updated_at":"2022-12-20 19:29:31","action_type":"update_custom_field","field_id":"5","field":{"id":"5","name":"City","key":"city","type":"text"},"date_operation":null,"value":"Lajpcig","description":"Update
63
+ custom field to \"Lajpcig\""}},{"id":"75230485991654734","status":"Completed","date":"2022-12-22
64
+ 21:43:02","reason":null,"reason_description":"","subscriber":{"id":"75009808379414225","email":"second@email.com"},"stepRuns":[{"id":"75230486076589396","step_id":"75040874340287587","description":"Update
65
+ custom field to \"Lajpcig\"","scheduled_for":null}],"currentStep":{"id":"75040874340287587","type":"action","parent_id":null,"complete":true,"broken":false,"created_at":"2022-12-20
66
+ 19:29:14","updated_at":"2022-12-20 19:29:31","action_type":"update_custom_field","field_id":"5","field":{"id":"5","name":"City","key":"city","type":"text"},"date_operation":null,"value":"Lajpcig","description":"Update
67
+ custom field to \"Lajpcig\""}}],"links":{"first":"https:\/\/connect.mailerlite.com\/api\/automations\/75040845299975641\/activity?page=1","last":"https:\/\/connect.mailerlite.com\/api\/automations\/75040845299975641\/activity?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo;
68
+ Previous","active":false},{"url":"https:\/\/connect.mailerlite.com\/api\/automations\/75040845299975641\/activity?page=1","label":"1","active":true},{"url":null,"label":"Next
69
+ &raquo;","active":false}],"path":"https:\/\/connect.mailerlite.com\/api\/automations\/75040845299975641\/activity","per_page":10,"to":3,"total":3}}'
70
+ recorded_at: Fri, 23 Dec 2022 12:29:49 GMT
71
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://connect.mailerlite.com/api/batch
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"requests":[{"method":"GET","path":"api/subscribers/list"},{"method":"GET","path":"api/campaigns/list"}]}'
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Fri, 23 Dec 2022 20:38:06 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '118'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77e3e6206cc0de47-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"total":2,"successful":0,"failed":2,"responses":[{"code":404,"body":{"message":"No
56
+ query results for model [App\\Models\\Subscriber\\Subscriber]."}},{"code":404,"body":{"message":"The
57
+ route api\/campaigns\/list could not be found."}}]}'
58
+ recorded_at: Fri, 23 Dec 2022 20:38:06 GMT
59
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://connect.mailerlite.com/api/campaigns/75037917434611569/reports/subscriber-activity
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"filter":{"type":"opened"}}'
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Fri, 23 Dec 2022 22:22:59 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '119'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77e47fc539c7de43-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":"75038031542749150","opens_count":1,"clicks_count":0,"subscriber":{"id":"73931277474989872","email":"sdk@mailerlite.com","status":"active","source":"manual","sent":2,"opens_count":2,"clicks_count":0,"open_rate":100,"click_rate":0,"ip_address":null,"subscribed_at":"2022-12-08
56
+ 13:32:40","unsubscribed_at":null,"created_at":"2022-12-08 13:32:40","updated_at":"2022-12-20
57
+ 18:45:03","fields":{"name":"SDK","last_name":null,"company":null,"country":null,"city":"Lajpcig","phone":null,"state":null,"z_i_p":null},"opted_in_at":null,"optin_ip":null}},{"id":"75038031600420839","opens_count":2,"clicks_count":0,"subscriber":{"id":"75030636641911843","email":"igor@hrcek.rs","status":"active","source":"webform","sent":1,"opens_count":1,"clicks_count":0,"open_rate":100,"click_rate":0,"ip_address":"89.216.27.147","subscribed_at":"2022-12-20
58
+ 16:46:31","unsubscribed_at":null,"created_at":"2022-12-20 16:46:31","updated_at":"2022-12-21
59
+ 07:45:50","fields":{"name":null,"last_name":null,"company":null,"country":null,"city":null,"phone":null,"state":null,"z_i_p":null},"opted_in_at":"2022-12-20
60
+ 16:46:42","optin_ip":"89.216.27.147"}}],"links":{"first":"https:\/\/connect.mailerlite.com\/api\/campaigns\/75037917434611569\/reports\/subscriber-activity?page=1","last":"https:\/\/connect.mailerlite.com\/api\/campaigns\/75037917434611569\/reports\/subscriber-activity?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo;
61
+ Previous","active":false},{"url":"https:\/\/connect.mailerlite.com\/api\/campaigns\/75037917434611569\/reports\/subscriber-activity?page=1","label":"1","active":true},{"url":null,"label":"Next
62
+ &raquo;","active":false}],"path":"https:\/\/connect.mailerlite.com\/api\/campaigns\/75037917434611569\/reports\/subscriber-activity","per_page":50,"to":2,"total":2,"counts":{"all":2,"opened":2,"unopened":0,"clicked":0,"unsubscribed":0,"forwarded":0,"hardbounced":0,"softbounced":0,"junk":0}}}'
63
+ recorded_at: Fri, 23 Dec 2022 22:22:58 GMT
64
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://connect.mailerlite.com/api/campaigns
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"test_campaign","type":"regular","emails":[{"subject":"test
9
+ subject","from":"sdk@mailerlite.com","from_name":"user"}]}'
10
+ headers:
11
+ Authorization:
12
+ - "<AUTH>"
13
+ User-Agent:
14
+ - MailerLite-client-ruby/0.1.1
15
+ Accept:
16
+ - application/json
17
+ Content-Type:
18
+ - application/json
19
+ Connection:
20
+ - close
21
+ Host:
22
+ - connect.mailerlite.com
23
+ response:
24
+ status:
25
+ code: 201
26
+ message: Created
27
+ headers:
28
+ Date:
29
+ - Mon, 19 Dec 2022 10:53:06 GMT
30
+ Content-Type:
31
+ - application/json
32
+ Transfer-Encoding:
33
+ - chunked
34
+ Connection:
35
+ - close
36
+ Cache-Control:
37
+ - no-cache, private
38
+ X-Locale:
39
+ - en
40
+ X-Ratelimit-Limit:
41
+ - '120'
42
+ X-Ratelimit-Remaining:
43
+ - '119'
44
+ Access-Control-Allow-Origin:
45
+ - "*"
46
+ Strict-Transport-Security:
47
+ - max-age=15724800; includeSubDomains
48
+ Cf-Cache-Status:
49
+ - DYNAMIC
50
+ Server:
51
+ - cloudflare
52
+ Cf-Ray:
53
+ - 77bf97b0e8b0d1e0-MCT
54
+ body:
55
+ encoding: UTF-8
56
+ string: '{"data":{"id":"74917804992628332","account_id":"252151","name":"test_campaign","type":"regular","status":"draft","missing_data":["content"],"settings":[],"filter":[],"filter_for_humans":[],"delivery_schedule":null,"language_id":"4","language":{"id":"4","shortcode":"en","iso639":"en-US","name":"English","direction":"ltr"},"created_at":"2022-12-19
57
+ 10:53:06","updated_at":"2022-12-19 10:53:06","scheduled_for":null,"queued_at":null,"started_at":null,"finished_at":null,"stopped_at":null,"default_email_id":"74917805026182765","emails":[{"id":"74917805026182765","account_id":"252151","emailable_id":"74917804992628332","emailable_type":"campaigns","type":null,"from":"sdk@mailerlite.com","from_name":"user","name":null,"subject":"test
58
+ subject","plain_text":"Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever,
59
+ your email software can''t display HTML emails. You can view the newsletter
60
+ by clicking here:\n\n{$url}\n\n\n\nYou''re receiving this newsletter because
61
+ you have shown interest in {$account}.\nNot interested anymore? Click here
62
+ to unsubscribe:\n{$unsubscribe}\n","screenshot_url":null,"preview_url":"https:\/\/preview.mailerlite.io\/preview\/252151\/emails\/74917805026182765","created_at":"2022-12-19
63
+ 10:53:06","updated_at":"2022-12-19 10:53:06","is_designed":false,"language_id":4,"language":{"id":"4","shortcode":"en","iso639":"en-US","name":"English","direction":"ltr"},"is_winner":false,"stats":{"sent":0,"opens_count":0,"unique_opens_count":0,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"},"forwards_count":0},"send_after":null,"track_opens":true,"uses_quiz":false}],"used_in_automations":false,"type_for_humans":"Regular","is_stopped":false,"has_winner":null,"winner_version_for_human":null,"winner_sending_time_for_humans":null,"winner_selected_manually_at":null,"can":{"update":true,"delete":true,"send":true,"copy":true,"resend":false},"uses_ecommerce":false,"uses_survey":false,"can_be_scheduled":false,"breadcrumbs":[{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/edit","text":"Details","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/emails\/74917805026182765\/edit","text":"Content","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/recipients\/basic","text":"Recipients","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/review","text":"Review","active":false,"disabled":false,"upcoming":false,"state":null},{"url":null,"text":"Schedule","active":false,"disabled":true,"upcoming":false,"state":"disabled"}],"warnings":[],"recipients_count":3,"next_step":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/review","is_currently_sending_out":false}}'
64
+ recorded_at: Mon, 19 Dec 2022 10:53:06 GMT
65
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://connect.mailerlite.com/api/campaigns/74917804992628332
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 204
25
+ message: No Content
26
+ headers:
27
+ Date:
28
+ - Mon, 19 Dec 2022 11:01:04 GMT
29
+ Connection:
30
+ - close
31
+ Cache-Control:
32
+ - no-cache, private
33
+ X-Locale:
34
+ - en
35
+ X-Ratelimit-Limit:
36
+ - '120'
37
+ X-Ratelimit-Remaining:
38
+ - '118'
39
+ Access-Control-Allow-Origin:
40
+ - "*"
41
+ Strict-Transport-Security:
42
+ - max-age=15724800; includeSubDomains
43
+ Cf-Cache-Status:
44
+ - DYNAMIC
45
+ Server:
46
+ - cloudflare
47
+ Cf-Ray:
48
+ - 77bfa35c0ac0d1ec-MCT
49
+ body:
50
+ encoding: ASCII-8BIT
51
+ string: ''
52
+ recorded_at: Mon, 19 Dec 2022 11:01:04 GMT
53
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://connect.mailerlite.com/api/campaigns/74917804992628332
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Mon, 19 Dec 2022 10:53:37 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '118'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77bf987469e7de5b-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":{"id":"74917804992628332","account_id":"252151","name":"test_campaign","type":"regular","status":"draft","missing_data":["content"],"settings":[],"filter":[],"filter_for_humans":[],"delivery_schedule":null,"language_id":"4","language":{"id":"4","shortcode":"en","iso639":"en-US","name":"English","direction":"ltr"},"created_at":"2022-12-19
56
+ 10:53:06","updated_at":"2022-12-19 10:53:06","scheduled_for":null,"queued_at":null,"started_at":null,"finished_at":null,"stopped_at":null,"default_email_id":"74917805026182765","emails":[{"id":"74917805026182765","account_id":"252151","emailable_id":"74917804992628332","emailable_type":"campaigns","type":null,"from":"sdk@mailerlite.com","from_name":"user","name":null,"subject":"test
57
+ subject","content":null,"plain_text":"Hello,\n\nYou have received a newsletter
58
+ from {$account}.\n\nHowever, your email software can''t display HTML emails.
59
+ You can view the newsletter by clicking here:\n\n{$url}\n\n\n\nYou''re receiving
60
+ this newsletter because you have shown interest in {$account}.\nNot interested
61
+ anymore? Click here to unsubscribe:\n{$unsubscribe}\n","screenshot_url":null,"preview_url":"https:\/\/preview.mailerlite.io\/preview\/252151\/emails\/74917805026182765","created_at":"2022-12-19
62
+ 10:53:06","updated_at":"2022-12-19 10:53:06","click_map":[],"is_designed":false,"language_id":4,"language":{"id":"4","shortcode":"en","iso639":"en-US","name":"English","direction":"ltr"},"is_winner":false,"stats":{"sent":0,"opens_count":0,"unique_opens_count":0,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"},"forwards_count":0},"send_after":null,"track_opens":true,"uses_quiz":false}],"used_in_automations":false,"type_for_humans":"Regular","is_stopped":false,"has_winner":null,"winner_version_for_human":null,"winner_sending_time_for_humans":null,"winner_selected_manually_at":null,"can":{"update":true,"delete":true,"send":true,"copy":true,"resend":false},"uses_ecommerce":false,"uses_survey":false,"can_be_scheduled":false,"breadcrumbs":[{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/edit","text":"Details","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/emails\/74917805026182765\/edit","text":"Content","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/recipients\/basic","text":"Recipients","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/review","text":"Review","active":false,"disabled":false,"upcoming":false,"state":null},{"url":null,"text":"Schedule","active":false,"disabled":true,"upcoming":false,"state":"disabled"}],"warnings":[],"recipients_count":3,"next_step":"https:\/\/dashboard.mailerlite.com\/campaigns\/74917804992628332\/review","is_currently_sending_out":false}}'
63
+ recorded_at: Mon, 19 Dec 2022 10:53:37 GMT
64
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://connect.mailerlite.com/api/campaigns?filter%5Bstatus%5D=sent&filter%5Btype%5D=regular
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - "<AUTH>"
12
+ User-Agent:
13
+ - MailerLite-client-ruby/0.1.1
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - connect.mailerlite.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Date:
28
+ - Fri, 23 Dec 2022 22:12:23 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - close
35
+ Cache-Control:
36
+ - no-cache, private
37
+ X-Locale:
38
+ - en
39
+ X-Ratelimit-Limit:
40
+ - '120'
41
+ X-Ratelimit-Remaining:
42
+ - '119'
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Strict-Transport-Security:
46
+ - max-age=15724800; includeSubDomains
47
+ Cf-Cache-Status:
48
+ - DYNAMIC
49
+ Server:
50
+ - cloudflare
51
+ Cf-Ray:
52
+ - 77e4703cdd83d1f4-MCT
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"data":[{"id":"75037917434611569","account_id":"252151","name":"Test
56
+ Campaign","type":"regular","status":"sent","missing_data":[],"settings":{"track_opens":"1","use_google_analytics":"0","ecommerce_tracking":"0"},"filter":[],"filter_for_humans":[],"delivery_schedule":"instant","language_id":"1","created_at":"2022-12-20
57
+ 18:42:14","updated_at":"2022-12-20 18:44:03","scheduled_for":"2022-12-20 18:43:43","queued_at":"2022-12-20
58
+ 18:44:02","started_at":"2022-12-20 18:44:03","finished_at":"2022-12-20 18:44:03","stopped_at":null,"default_email_id":"75037917465020274","emails":[{"id":"75037917465020274","account_id":"252151","emailable_id":"75037917434611569","emailable_type":"campaigns","type":"builder_html","from":"testuser@mailerlite.com","from_name":"Test
59
+ Man","name":null,"subject":"This is a test campaign","plain_text":"Sveiki,\n\nJ\u016bs
60
+ gavote {$account} naujienlai\u0161k\u012f. Ta\u010diau J\u016bs\u0173 el.
61
+ pa\u0161to programa programa nepalaiko HTML formato.\n\nNaujienlai\u0161k\u012f
62
+ galite rasti \u010dia:\n\n{$url}\n\nPagarbiai,\n{$account}\n\n\n\nJeigu ateityje
63
+ nebenorite gauti {$account} naujien\u0173, spauskite \u010dia:\n{$unsubscribe}\n","screenshot_url":"https:\/\/storage.googleapis.com\/mailerlite-screenshots-prod\/screenshot\/emails\/75037917465020274\/1284x736.png","preview_url":"https:\/\/preview.mailerlite.io\/preview\/252151\/emails\/75037917465020274","created_at":"2022-12-20
64
+ 18:42:14","updated_at":"2022-12-21 07:46:52","is_designed":true,"language_id":1,"is_winner":false,"stats":{"sent":2,"opens_count":3,"unique_opens_count":2,"open_rate":{"float":1,"string":"100%"},"clicks_count":0,"unique_clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"},"forwards_count":0},"send_after":null,"track_opens":true,"uses_quiz":false}],"used_in_automations":false,"type_for_humans":"Regular","stats":{"sent":2,"opens_count":2,"unique_opens_count":2,"open_rate":{"float":1,"string":"100%"},"clicks_count":0,"unique_clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"},"forwards_count":0,"click_to_open_rate":{"float":0,"string":"0%"}},"is_stopped":false,"has_winner":null,"winner_version_for_human":null,"winner_sending_time_for_humans":null,"winner_selected_manually_at":null,"can":{"update":true,"delete":true,"send":true,"copy":true,"resend":true},"uses_ecommerce":false,"uses_survey":false,"can_be_scheduled":false,"warnings":[],"initial_created_at":null,"is_currently_sending_out":false}],"links":{"first":"https:\/\/connect.mailerlite.com\/api\/campaigns?page=1","last":"https:\/\/connect.mailerlite.com\/api\/campaigns?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo;
65
+ Previous","active":false},{"url":"https:\/\/connect.mailerlite.com\/api\/campaigns?page=1","label":"1","active":true},{"url":null,"label":"Next
66
+ &raquo;","active":false}],"path":"https:\/\/connect.mailerlite.com\/api\/campaigns","per_page":25,"to":1,"total":1,"aggregations":{"total":2,"draft":1,"ready":0,"sent":1}}}'
67
+ recorded_at: Fri, 23 Dec 2022 22:12:22 GMT
68
+ recorded_with: VCR 6.1.0