braze_ruby 0.2.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +30 -0
  3. data/.gitignore +1 -0
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +39 -39
  6. data/README.md +48 -0
  7. data/Rakefile +2 -0
  8. data/braze_ruby.gemspec +7 -7
  9. data/lib/braze_ruby.rb +2 -0
  10. data/lib/braze_ruby/api.rb +12 -4
  11. data/lib/braze_ruby/deprecated.rb +2 -0
  12. data/lib/braze_ruby/endpoints.rb +3 -0
  13. data/lib/braze_ruby/endpoints/campaigns.rb +3 -1
  14. data/lib/braze_ruby/endpoints/canvas.rb +15 -0
  15. data/lib/braze_ruby/endpoints/delete_users.rb +4 -2
  16. data/lib/braze_ruby/endpoints/email_status.rb +3 -1
  17. data/lib/braze_ruby/endpoints/email_sync.rb +4 -2
  18. data/lib/braze_ruby/endpoints/identify_users.rb +19 -0
  19. data/lib/braze_ruby/endpoints/schedule_messages.rb +3 -1
  20. data/lib/braze_ruby/endpoints/send_messages.rb +3 -1
  21. data/lib/braze_ruby/endpoints/subscription.rb +20 -0
  22. data/lib/braze_ruby/endpoints/track_users.rb +7 -5
  23. data/lib/braze_ruby/http.rb +20 -5
  24. data/lib/braze_ruby/rest.rb +8 -0
  25. data/lib/braze_ruby/rest/base.rb +6 -2
  26. data/lib/braze_ruby/rest/canvas_details.rb +20 -0
  27. data/lib/braze_ruby/rest/delete_users.rb +3 -2
  28. data/lib/braze_ruby/rest/email_hard_bounces.rb +5 -5
  29. data/lib/braze_ruby/rest/email_status.rb +5 -5
  30. data/lib/braze_ruby/rest/email_unsubscribes.rb +5 -5
  31. data/lib/braze_ruby/rest/export_users.rb +7 -7
  32. data/lib/braze_ruby/rest/identify_users.rb +13 -0
  33. data/lib/braze_ruby/rest/list_segments.rb +4 -4
  34. data/lib/braze_ruby/rest/schedule_messages.rb +5 -5
  35. data/lib/braze_ruby/rest/send_messages.rb +5 -5
  36. data/lib/braze_ruby/rest/subscription_status_get.rb +20 -0
  37. data/lib/braze_ruby/rest/subscription_status_set.rb +20 -0
  38. data/lib/braze_ruby/rest/subscription_user_status.rb +20 -0
  39. data/lib/braze_ruby/rest/track_users.rb +3 -2
  40. data/lib/braze_ruby/rest/trigger_campaign_send.rb +6 -8
  41. data/lib/braze_ruby/rest/trigger_canvas_send.rb +20 -0
  42. data/lib/braze_ruby/version.rb +3 -1
  43. data/spec/braze_ruby/api_spec.rb +2 -0
  44. data/spec/braze_ruby/endpoints/delete_users_spec.rb +3 -1
  45. data/spec/braze_ruby/endpoints/track_users_spec.rb +10 -8
  46. data/spec/braze_ruby/http_spec.rb +48 -0
  47. data/spec/braze_ruby/rest/delete_users_spec.rb +5 -3
  48. data/spec/braze_ruby/rest/email_status_spec.rb +3 -2
  49. data/spec/braze_ruby/rest/export_users_spec.rb +5 -3
  50. data/spec/braze_ruby/rest/identify_users_spec.rb +23 -0
  51. data/spec/braze_ruby/rest/schedule_messages_spec.rb +3 -2
  52. data/spec/braze_ruby/rest/send_messages_spec.rb +10 -13
  53. data/spec/braze_ruby/rest/track_users_spec.rb +12 -9
  54. data/spec/factories.rb +2 -0
  55. data/spec/fixtures/responses/campaigns/trigger_send/sends_an_email.yml +17 -15
  56. data/spec/fixtures/responses/canvas/details/returns_error_when_no_canvas.yml +69 -0
  57. data/spec/fixtures/responses/canvas/trigger_send/sends_a_canvas.yml +71 -0
  58. data/spec/fixtures/responses/delete_users/unauthorized/responds_with_unauthorized.yml +20 -18
  59. data/spec/fixtures/responses/delete_users/with_success/responds_with_created.yml +25 -23
  60. data/spec/fixtures/responses/delete_users/with_success/responds_with_success_message.yml +25 -23
  61. data/spec/fixtures/responses/email_status/existing_email/responds_with_created.yml +22 -20
  62. data/spec/fixtures/responses/email_status/existing_email/responds_with_success_message.yml +22 -20
  63. data/spec/fixtures/responses/email_status/unknown_email/responds_with_bad_request.yml +22 -20
  64. data/spec/fixtures/responses/email_status/unknown_email/responds_with_success_message.yml +22 -20
  65. data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +18 -16
  66. data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +18 -16
  67. data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +21 -20
  68. data/spec/fixtures/responses/export_users/by_ids/with_success/responds_with_created.yml +25 -22
  69. data/spec/fixtures/responses/export_users/by_segment/with_success/responds_with_created.yml +24 -22
  70. data/spec/fixtures/responses/identify_users/unauthorized/responds_with_unauthorized.yml +68 -0
  71. data/spec/fixtures/responses/identify_users/with_success/responds_with_created.yml +71 -0
  72. data/spec/fixtures/responses/identify_users/with_success/responds_with_success_message.yml +71 -0
  73. data/spec/fixtures/responses/list_segments/with_success/responds_with_a_list_of_segments.yml +35 -35
  74. data/spec/fixtures/responses/list_segments/with_success/responds_with_success.yml +35 -35
  75. data/spec/fixtures/responses/schedule_messages/unauthorized/responds_with_unauthorize.yml +20 -19
  76. data/spec/fixtures/responses/schedule_messages/with_success/responds_with_created.yml +24 -23
  77. data/spec/fixtures/responses/schedule_messages/with_success/responds_with_success_message.yml +24 -23
  78. data/spec/fixtures/responses/send_messages/unauthorized/responds_with_unauthorized.yml +20 -18
  79. data/spec/fixtures/responses/send_messages/with_success/responds_with_created.yml +24 -22
  80. data/spec/fixtures/responses/send_messages/with_success/responds_with_success_message.yml +24 -22
  81. data/spec/fixtures/responses/subscription/subscription_status_set/when_subscribing/subscribes_the_user.yml +71 -0
  82. data/spec/fixtures/responses/subscription/subscription_status_set/when_subscription_group_does_not_exist/returns_an_error_status.yml +68 -0
  83. data/spec/fixtures/responses/subscription/subscription_status_set/when_unsubscribing/unsubscribes_the_user.yml +139 -0
  84. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_checking_subscribed_and_unsubscribed_user_status/returns_only_users_that_were_once_subscribed.yml +211 -0
  85. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_group_does_not_exist/returns_an_error.yml +199 -0
  86. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_user_status/returns_subscription_groups_and_status_for_every_group.yml +211 -0
  87. data/spec/fixtures/responses/track_users/unauthorized/responds_with_unauthorized.yml +23 -21
  88. data/spec/fixtures/responses/track_users/with_success/responds_with_created.yml +22 -20
  89. data/spec/fixtures/responses/track_users/with_success/responds_with_success_message.yml +22 -20
  90. data/spec/integrations/campaigns_spec.rb +6 -2
  91. data/spec/integrations/canvas_spec.rb +28 -0
  92. data/spec/integrations/delete_users_spec.rb +3 -0
  93. data/spec/integrations/email_status_spec.rb +2 -0
  94. data/spec/integrations/email_sync_spec.rb +4 -2
  95. data/spec/integrations/export_users_spec.rb +4 -2
  96. data/spec/integrations/identify_users_spec.rb +32 -0
  97. data/spec/integrations/list_segments_spec.rb +3 -1
  98. data/spec/integrations/schedule_messages_spec.rb +4 -1
  99. data/spec/integrations/send_messages_spec.rb +4 -1
  100. data/spec/integrations/subscription_spec.rb +149 -0
  101. data/spec/integrations/track_users_spec.rb +3 -0
  102. data/spec/spec_helper.rb +2 -8
  103. data/spec/support/factory_bot.rb +2 -0
  104. data/spec/support/integrations.rb +7 -1
  105. data/spec/support/vcr.rb +5 -1
  106. metadata +63 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5649f519796cde810f2c2e2028c5a14fbcdfc7c6d93cf33043068fb4195b481
4
- data.tar.gz: b81d2eed4f84937c0bd4721318c2474f36e987d97418961fb407744dcee068fb
3
+ metadata.gz: c8cd9bb68fd35c0ccd7a9ecae5c5231696f2a48e906cea65f4436d7383167916
4
+ data.tar.gz: 54c80de739f86eaf92321a6ff2a2fae377e17c2915427ea614e242547debd32a
5
5
  SHA512:
6
- metadata.gz: 766e1d5e83222af37ba40d6e1333ea6e350b4e9ae327e943a31dfc60772253368a67fe8048b5ef72681759ce8e1ab13a7bdeb6c77fe92c82f167094881c22830
7
- data.tar.gz: a1011b8b5f84bba75a5eae4bb1535d0582788ea10ef838b6821912a05dad3f3abc06bc4033a93004c3554b05ca949d74f40916caa4115f2dc9087cf066f418bf
6
+ metadata.gz: 8862330d38a1b209bcb0afcb4ad11140e91c76cb3d4070010ed39f8272c3a21834412e5d41945e2e5a0e1ed8bc162e6ef75d92933e5e16b7cb1960e7bf1ff0ed
7
+ data.tar.gz: 6df0f44bc9e59531234a465384eb2ad7996abf43329f84aa0efff5714c980269277e83f464e0b6e33a54fc2ef6753e66d48110f34dbda8e4fa0bb203c024de39
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+
12
+ - name: Set up Ruby
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6
16
+
17
+ - name: Cache gems
18
+ uses: actions/cache@v1
19
+ with:
20
+ path: vendor/bundle
21
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
22
+ restore-keys: |
23
+ ${{ runner.os }}-gems-
24
+
25
+ - name: Build and test
26
+ run: |
27
+ gem install bundler
28
+ bundle config path vendor/bundle
29
+ bundle install --jobs 4 --retry 3
30
+ bundle exec rake spec
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  .config
5
5
  .yardoc
6
6
  .ruby-version
7
+ .ruby-gemset
7
8
  .env
8
9
  InstalledFiles
9
10
  _yardoc
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in braze_ruby.gemspec
@@ -1,64 +1,64 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- braze_ruby (0.2.1)
4
+ braze_ruby (0.4.0)
5
5
  faraday
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.0)
10
+ activesupport (6.0.3.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 0.7, < 2)
13
13
  minitest (~> 5.1)
14
14
  tzinfo (~> 1.1)
15
- zeitwerk (~> 2.1, >= 2.1.8)
15
+ zeitwerk (~> 2.2, >= 2.2.2)
16
16
  addressable (2.7.0)
17
17
  public_suffix (>= 2.0.2, < 5.0)
18
- coderay (1.1.2)
19
- concurrent-ruby (1.1.5)
18
+ coderay (1.1.3)
19
+ concurrent-ruby (1.1.6)
20
20
  crack (0.4.3)
21
21
  safe_yaml (~> 1.0.0)
22
22
  diff-lcs (1.3)
23
23
  dotenv (2.7.5)
24
- factory_bot (5.0.2)
24
+ factory_bot (5.2.0)
25
25
  activesupport (>= 4.2.0)
26
- faraday (0.15.4)
26
+ faraday (1.0.1)
27
27
  multipart-post (>= 1.2, < 3)
28
- hashdiff (1.0.0)
29
- i18n (1.6.0)
28
+ hashdiff (1.0.1)
29
+ i18n (1.8.3)
30
30
  concurrent-ruby (~> 1.0)
31
- method_source (0.9.2)
32
- minitest (5.11.3)
31
+ method_source (1.0.0)
32
+ minitest (5.14.1)
33
33
  multipart-post (2.1.1)
34
- pry (0.12.2)
35
- coderay (~> 1.1.0)
36
- method_source (~> 0.9.0)
37
- public_suffix (4.0.1)
38
- rake (12.3.3)
39
- rspec (3.8.0)
40
- rspec-core (~> 3.8.0)
41
- rspec-expectations (~> 3.8.0)
42
- rspec-mocks (~> 3.8.0)
43
- rspec-core (3.8.2)
44
- rspec-support (~> 3.8.0)
45
- rspec-expectations (3.8.4)
34
+ pry (0.13.1)
35
+ coderay (~> 1.1)
36
+ method_source (~> 1.0)
37
+ public_suffix (4.0.5)
38
+ rake (13.0.1)
39
+ rspec (3.9.0)
40
+ rspec-core (~> 3.9.0)
41
+ rspec-expectations (~> 3.9.0)
42
+ rspec-mocks (~> 3.9.0)
43
+ rspec-core (3.9.2)
44
+ rspec-support (~> 3.9.3)
45
+ rspec-expectations (3.9.2)
46
46
  diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.8.0)
48
- rspec-mocks (3.8.1)
47
+ rspec-support (~> 3.9.0)
48
+ rspec-mocks (3.9.1)
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.8.0)
51
- rspec-support (3.8.2)
50
+ rspec-support (~> 3.9.0)
51
+ rspec-support (3.9.3)
52
52
  safe_yaml (1.0.5)
53
53
  thread_safe (0.3.6)
54
- tzinfo (1.2.5)
54
+ tzinfo (1.2.7)
55
55
  thread_safe (~> 0.1)
56
- vcr (5.0.0)
57
- webmock (3.7.1)
56
+ vcr (6.0.0)
57
+ webmock (3.8.3)
58
58
  addressable (>= 2.3.6)
59
59
  crack (>= 0.3.2)
60
60
  hashdiff (>= 0.4.0, < 2.0.0)
61
- zeitwerk (2.1.9)
61
+ zeitwerk (2.3.0)
62
62
 
63
63
  PLATFORMS
64
64
  ruby
@@ -66,13 +66,13 @@ PLATFORMS
66
66
  DEPENDENCIES
67
67
  braze_ruby!
68
68
  bundler (>= 1.3)
69
- dotenv
70
- factory_bot
71
- pry
72
- rake
73
- rspec
74
- vcr
75
- webmock
69
+ dotenv (~> 2.7.5)
70
+ factory_bot (>= 5.1.0)
71
+ pry (>= 0.12.2)
72
+ rake (>= 12.3.3)
73
+ rspec (~> 3.8)
74
+ vcr (>= 5.0.0)
75
+ webmock (>= 3.7.5)
76
76
 
77
77
  BUNDLED WITH
78
- 2.0.2
78
+ 2.1.4
data/README.md CHANGED
@@ -121,6 +121,15 @@ api.trigger_campaign_send(
121
121
  )
122
122
  ```
123
123
 
124
+ ### Send Canvas
125
+
126
+ ```ruby
127
+ api.trigger_canvas_send(
128
+ canvas_id: 'canvas-id',
129
+ recipients: [external_user_id: 123, canvas_entry_properties: {first_name: 'John'}]
130
+ )
131
+ ```
132
+
124
133
  ### Changing Email Subscription
125
134
 
126
135
  ```ruby
@@ -154,6 +163,45 @@ Delete Braze Users with an array of external_ids
154
163
  api.delete_users([1, 2, 3])
155
164
  ```
156
165
 
166
+ ### Subscription groups
167
+
168
+ #### Get subscription group status for users by id
169
+ ```ruby
170
+ api.subscription_user_status(external_id: [1])
171
+ ```
172
+
173
+ #### Get users status for a specific subscription group
174
+ ```ruby
175
+ api.subscription_status_get(
176
+ external_id: [1],
177
+ subscription_group_id: 'some-uuid'
178
+ )
179
+ ```
180
+
181
+ #### Set user status for a specific subscription group
182
+ ```ruby
183
+ api.subscription_status_set(
184
+ external_id: [1],
185
+ subscription_group_id: 'some-uuid',
186
+ subscription_state: 'subscribed|unsubscribed'
187
+ )
188
+ ```
189
+
190
+ ### User Identification
191
+
192
+ #### Identify an alias-only user
193
+ ```ruby
194
+ api.identify_users(
195
+ aliases_to_identify: [{
196
+ external_id: 1234,
197
+ user_alias: {
198
+ alias_name: "device123",
199
+ alias_label: "my_device_identifier",
200
+ }
201
+ }]
202
+ )
203
+ ```
204
+
157
205
  ## Debugging
158
206
 
159
207
  The BRAZE_RUBY_DEBUG environment variable will trigger full printouts of the Faraday gem's HTTP requests and responses.
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
3
5
 
@@ -28,11 +28,11 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'faraday'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '>= 1.3'
31
- spec.add_development_dependency 'rake'
32
- spec.add_development_dependency 'rspec'
33
- spec.add_development_dependency 'dotenv'
34
- spec.add_development_dependency 'vcr'
35
- spec.add_development_dependency 'webmock'
36
- spec.add_development_dependency 'pry'
37
- spec.add_development_dependency 'factory_bot'
31
+ spec.add_development_dependency 'rake', '>= 12.3.3'
32
+ spec.add_development_dependency 'rspec', '~> 3.8'
33
+ spec.add_development_dependency 'dotenv', '~> 2.7.5'
34
+ spec.add_development_dependency 'vcr', '>= 5.0.0'
35
+ spec.add_development_dependency 'webmock', '>= 3.7.5'
36
+ spec.add_development_dependency 'pry', '>= 0.12.2'
37
+ spec.add_development_dependency 'factory_bot', '>= 5.1.0'
38
38
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'braze_ruby/version'
2
4
 
3
5
  module BrazeRuby
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'braze_ruby/deprecated'
2
4
  require 'braze_ruby/endpoints/track_users'
3
5
  require 'braze_ruby/endpoints/send_messages'
@@ -6,6 +8,8 @@ require 'braze_ruby/endpoints/email_status'
6
8
  require 'braze_ruby/endpoints/email_sync'
7
9
  require 'braze_ruby/endpoints/delete_users'
8
10
  require 'braze_ruby/endpoints/campaigns'
11
+ require 'braze_ruby/endpoints/canvas'
12
+ require 'braze_ruby/endpoints/subscription'
9
13
 
10
14
  module BrazeRuby
11
15
  class API
@@ -18,20 +22,24 @@ module BrazeRuby
18
22
  include BrazeRuby::Endpoints::EmailSync
19
23
  include BrazeRuby::Endpoints::DeleteUsers
20
24
  include BrazeRuby::Endpoints::Campaigns
25
+ include BrazeRuby::Endpoints::Canvas
26
+ include BrazeRuby::Endpoints::Subscription
27
+ include BrazeRuby::Endpoints::IdentifyUsers
21
28
 
22
29
  def export_users(**payload)
23
- BrazeRuby::REST::ExportUsers.new(braze_url).perform(api_key, payload)
30
+ BrazeRuby::REST::ExportUsers.new(api_key, braze_url, options).perform(**payload)
24
31
  end
25
32
 
26
33
  def list_segments
27
- BrazeRuby::REST::ListSegments.new(braze_url).perform(api_key)
34
+ BrazeRuby::REST::ListSegments.new(api_key, braze_url, options).perform
28
35
  end
29
36
 
30
- attr_reader :api_key, :braze_url
37
+ attr_reader :api_key, :braze_url, :options
31
38
 
32
- def initialize(api_key, braze_url)
39
+ def initialize(api_key, braze_url, options = {})
33
40
  @api_key = api_key
34
41
  @braze_url = braze_url
42
+ @options = options
35
43
  end
36
44
  end
37
45
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BrazeRuby
2
4
  module Deprecated
3
5
  def track(attribute, events = [], purchases = [])
@@ -1,6 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'braze_ruby/endpoints/email_status'
2
4
  require 'braze_ruby/endpoints/email_sync'
3
5
  require 'braze_ruby/endpoints/schedule_messages'
4
6
  require 'braze_ruby/endpoints/send_messages'
5
7
  require 'braze_ruby/endpoints/track_users'
6
8
  require 'braze_ruby/endpoints/delete_users'
9
+ require 'braze_ruby/endpoints/identify_users'
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BrazeRuby
2
4
  module Endpoints
3
5
  module Campaigns
4
6
  def trigger_campaign_send(**payload)
5
- BrazeRuby::REST::TriggerCampaignSend.new(api_key, braze_url, payload).perform
7
+ BrazeRuby::REST::TriggerCampaignSend.new(api_key, braze_url, options, **payload).perform
6
8
  end
7
9
  end
8
10
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeRuby
4
+ module Endpoints
5
+ module Canvas
6
+ def trigger_canvas_send(**payload)
7
+ BrazeRuby::REST::TriggerCanvasSend.new(api_key, braze_url, options, **payload).perform
8
+ end
9
+
10
+ def canvas_details(**payload)
11
+ BrazeRuby::REST::CanvasDetails.new(api_key, braze_url, options, **payload).perform
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BrazeRuby
2
4
  module Endpoints
3
5
  module DeleteUsers
4
6
  attr_writer :delete_users_service
5
7
 
6
8
  def delete_users_action(**payload)
7
- delete_users_service.perform(api_key, payload)
9
+ delete_users_service.perform(**payload)
8
10
  end
9
11
 
10
12
  def delete_users(payload)
@@ -14,7 +16,7 @@ module BrazeRuby
14
16
  private
15
17
 
16
18
  def delete_users_service
17
- @delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(braze_url)
19
+ @delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(api_key, braze_url, options)
18
20
  end
19
21
  end
20
22
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BrazeRuby
2
4
  module Endpoints
3
5
  module EmailStatus
4
6
  def email_status(**payload)
5
- email_status_service.new(api_key, braze_url, payload).perform
7
+ email_status_service.new(api_key, braze_url, options, **payload).perform
6
8
  end
7
9
 
8
10
  def email_status_service
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BrazeRuby
2
4
  module Endpoints
3
5
  module EmailSync
4
6
  def email_unsubscribes(**payload)
5
- BrazeRuby::REST::EmailUnsubscribes.new(api_key, braze_url, payload).perform
7
+ BrazeRuby::REST::EmailUnsubscribes.new(api_key, braze_url, options, **payload).perform
6
8
  end
7
9
 
8
10
  def email_hard_bounces(**payload)
9
- BrazeRuby::REST::EmailHardBounces.new(api_key, braze_url, payload).perform
11
+ BrazeRuby::REST::EmailHardBounces.new(api_key, braze_url, options, **payload).perform
10
12
  end
11
13
  end
12
14
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeRuby
4
+ module Endpoints
5
+ module IdentifyUsers
6
+ attr_writer :identify_users_service
7
+
8
+ def identify_users(**payload)
9
+ identify_users_service.perform(**payload)
10
+ end
11
+
12
+ private
13
+
14
+ def identify_users_service
15
+ @identify_users_service ||= BrazeRuby::REST::IdentifyUsers.new(api_key, braze_url, options)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BrazeRuby
2
4
  module Endpoints
3
5
  module ScheduleMessages
4
6
  def schedule_messages(**payload)
5
- schedule_messages_service.new(api_key, braze_url, payload).perform
7
+ schedule_messages_service.new(api_key, braze_url, options, **payload).perform
6
8
  end
7
9
 
8
10
  private