braze_ruby 0.3.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +57 -0
- data/.circleci/gem_credentials +2 -0
- data/.circleci/setup-rubygems +6 -0
- data/.gitignore +12 -19
- data/.standard.yml +1 -0
- data/Gemfile +1 -2
- data/LICENSE.txt +17 -18
- data/README.md +49 -2
- data/Rakefile +2 -1
- data/bin/release +16 -0
- data/braze_ruby.gemspec +28 -31
- data/lib/braze_ruby.rb +4 -4
- data/lib/braze_ruby/api.rb +20 -14
- data/lib/braze_ruby/deprecated.rb +4 -4
- data/lib/braze_ruby/endpoints.rb +10 -7
- data/lib/braze_ruby/endpoints/campaigns.rb +1 -1
- data/lib/braze_ruby/endpoints/canvas.rb +2 -2
- data/lib/braze_ruby/endpoints/create_user_aliases.rb +19 -0
- data/lib/braze_ruby/endpoints/delete_users.rb +2 -2
- data/lib/braze_ruby/endpoints/email_status.rb +1 -1
- data/lib/braze_ruby/endpoints/email_sync.rb +2 -2
- data/lib/braze_ruby/endpoints/identify_users.rb +2 -2
- data/lib/braze_ruby/endpoints/remove_external_ids.rb +19 -0
- data/lib/braze_ruby/endpoints/rename_external_ids.rb +19 -0
- data/lib/braze_ruby/endpoints/schedule_messages.rb +1 -1
- data/lib/braze_ruby/endpoints/send_messages.rb +1 -1
- data/lib/braze_ruby/endpoints/subscription.rb +3 -4
- data/lib/braze_ruby/endpoints/track_users.rb +5 -5
- data/lib/braze_ruby/http.rb +21 -8
- data/lib/braze_ruby/rest.rb +20 -17
- data/lib/braze_ruby/rest/base.rb +5 -3
- data/lib/braze_ruby/rest/canvas_details.rb +4 -6
- data/lib/braze_ruby/rest/create_user_aliases.rb +13 -0
- data/lib/braze_ruby/rest/delete_users.rb +3 -4
- data/lib/braze_ruby/rest/email_hard_bounces.rb +4 -6
- data/lib/braze_ruby/rest/email_status.rb +6 -8
- data/lib/braze_ruby/rest/email_unsubscribes.rb +4 -6
- data/lib/braze_ruby/rest/export_users.rb +9 -11
- data/lib/braze_ruby/rest/identify_users.rb +3 -4
- data/lib/braze_ruby/rest/list_segments.rb +2 -4
- data/lib/braze_ruby/rest/remove_external_ids.rb +13 -0
- data/lib/braze_ruby/rest/rename_external_ids.rb +13 -0
- data/lib/braze_ruby/rest/schedule_messages.rb +9 -11
- data/lib/braze_ruby/rest/send_messages.rb +6 -8
- data/lib/braze_ruby/rest/subscription_status_get.rb +4 -6
- data/lib/braze_ruby/rest/subscription_status_set.rb +4 -6
- data/lib/braze_ruby/rest/subscription_user_status.rb +4 -6
- data/lib/braze_ruby/rest/track_users.rb +5 -6
- data/lib/braze_ruby/rest/trigger_campaign_send.rb +4 -8
- data/lib/braze_ruby/rest/trigger_canvas_send.rb +4 -6
- data/lib/braze_ruby/version.rb +1 -1
- metadata +61 -175
- data/.github/workflows/ci.yml +0 -19
- data/Gemfile.lock +0 -78
- data/spec/braze_ruby/api_spec.rb +0 -6
- data/spec/braze_ruby/endpoints/delete_users_spec.rb +0 -31
- data/spec/braze_ruby/endpoints/track_users_spec.rb +0 -74
- data/spec/braze_ruby/rest/delete_users_spec.rb +0 -22
- data/spec/braze_ruby/rest/email_status_spec.rb +0 -21
- data/spec/braze_ruby/rest/export_users_spec.rb +0 -21
- data/spec/braze_ruby/rest/identify_users_spec.rb +0 -23
- data/spec/braze_ruby/rest/schedule_messages_spec.rb +0 -38
- data/spec/braze_ruby/rest/send_messages_spec.rb +0 -35
- data/spec/braze_ruby/rest/track_users_spec.rb +0 -26
- data/spec/factories.rb +0 -38
- data/spec/fixtures/responses/campaigns/trigger_send/sends_an_email.yml +0 -69
- data/spec/fixtures/responses/canvas/details/returns_error_when_no_canvas.yml +0 -67
- data/spec/fixtures/responses/canvas/trigger_send/sends_a_canvas.yml +0 -69
- data/spec/fixtures/responses/delete_users/unauthorized/responds_with_unauthorized.yml +0 -66
- data/spec/fixtures/responses/delete_users/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/delete_users/with_success/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/email_status/existing_email/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/email_status/existing_email/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/email_status/unknown_email/responds_with_bad_request.yml +0 -69
- data/spec/fixtures/responses/email_status/unknown_email/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +0 -73
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +0 -73
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +0 -74
- data/spec/fixtures/responses/export_users/by_ids/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/export_users/by_segment/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/identify_users/unauthorized/responds_with_unauthorized.yml +0 -66
- data/spec/fixtures/responses/identify_users/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/identify_users/with_success/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/list_segments/with_success/responds_with_a_list_of_segments.yml +0 -81
- data/spec/fixtures/responses/list_segments/with_success/responds_with_success.yml +0 -81
- data/spec/fixtures/responses/schedule_messages/unauthorized/responds_with_unauthorize.yml +0 -67
- data/spec/fixtures/responses/schedule_messages/with_success/responds_with_created.yml +0 -70
- data/spec/fixtures/responses/schedule_messages/with_success/responds_with_success_message.yml +0 -70
- data/spec/fixtures/responses/send_messages/unauthorized/responds_with_unauthorized.yml +0 -66
- data/spec/fixtures/responses/send_messages/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/send_messages/with_success/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/subscription/subscription_status_set/when_subscribing/subscribes_the_user.yml +0 -69
- data/spec/fixtures/responses/subscription/subscription_status_set/when_subscription_group_does_not_exist/returns_an_error_status.yml +0 -66
- data/spec/fixtures/responses/subscription/subscription_status_set/when_unsubscribing/unsubscribes_the_user.yml +0 -135
- 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 +0 -205
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_group_does_not_exist/returns_an_error.yml +0 -193
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_user_status/returns_subscription_groups_and_status_for_every_group.yml +0 -207
- data/spec/fixtures/responses/track_users/unauthorized/responds_with_unauthorized.yml +0 -68
- data/spec/fixtures/responses/track_users/with_success/responds_with_created.yml +0 -71
- data/spec/fixtures/responses/track_users/with_success/responds_with_success_message.yml +0 -71
- data/spec/integrations/campaigns_spec.rb +0 -17
- data/spec/integrations/canvas_spec.rb +0 -26
- data/spec/integrations/delete_users_spec.rb +0 -31
- data/spec/integrations/email_status_spec.rb +0 -38
- data/spec/integrations/email_sync_spec.rb +0 -31
- data/spec/integrations/export_users_spec.rb +0 -29
- data/spec/integrations/identify_users_spec.rb +0 -32
- data/spec/integrations/list_segments_spec.rb +0 -21
- data/spec/integrations/schedule_messages_spec.rb +0 -33
- data/spec/integrations/send_messages_spec.rb +0 -32
- data/spec/integrations/subscription_spec.rb +0 -149
- data/spec/integrations/track_users_spec.rb +0 -37
- data/spec/spec_helper.rb +0 -33
- data/spec/support/factory_bot.rb +0 -12
- data/spec/support/integrations.rb +0 -23
- data/spec/support/vcr.rb +0 -18
@@ -4,7 +4,7 @@ module BrazeRuby
|
|
4
4
|
module Endpoints
|
5
5
|
module Campaigns
|
6
6
|
def trigger_campaign_send(**payload)
|
7
|
-
BrazeRuby::REST::TriggerCampaignSend.new(api_key, braze_url, payload).perform
|
7
|
+
BrazeRuby::REST::TriggerCampaignSend.new(api_key, braze_url, options, **payload).perform
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -4,11 +4,11 @@ module BrazeRuby
|
|
4
4
|
module Endpoints
|
5
5
|
module Canvas
|
6
6
|
def trigger_canvas_send(**payload)
|
7
|
-
BrazeRuby::REST::TriggerCanvasSend.new(api_key, braze_url, payload).perform
|
7
|
+
BrazeRuby::REST::TriggerCanvasSend.new(api_key, braze_url, options, **payload).perform
|
8
8
|
end
|
9
9
|
|
10
10
|
def canvas_details(**payload)
|
11
|
-
BrazeRuby::REST::CanvasDetails.new(api_key, braze_url, payload).perform
|
11
|
+
BrazeRuby::REST::CanvasDetails.new(api_key, braze_url, options, **payload).perform
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BrazeRuby
|
4
|
+
module Endpoints
|
5
|
+
module CreateUserAliases
|
6
|
+
attr_writer :create_user_aliases_service
|
7
|
+
|
8
|
+
def create_user_aliases(**payload)
|
9
|
+
create_user_aliases_service.perform(**payload)
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def create_user_aliases_service
|
15
|
+
@create_user_aliases_service ||= BrazeRuby::REST::CreateUserAliases.new(api_key, braze_url, options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -6,7 +6,7 @@ module BrazeRuby
|
|
6
6
|
attr_writer :delete_users_service
|
7
7
|
|
8
8
|
def delete_users_action(**payload)
|
9
|
-
delete_users_service.perform(
|
9
|
+
delete_users_service.perform(**payload)
|
10
10
|
end
|
11
11
|
|
12
12
|
def delete_users(payload)
|
@@ -16,7 +16,7 @@ module BrazeRuby
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def delete_users_service
|
19
|
-
@delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(braze_url)
|
19
|
+
@delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(api_key, braze_url, options)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -4,11 +4,11 @@ module BrazeRuby
|
|
4
4
|
module Endpoints
|
5
5
|
module EmailSync
|
6
6
|
def email_unsubscribes(**payload)
|
7
|
-
BrazeRuby::REST::EmailUnsubscribes.new(api_key, braze_url, payload).perform
|
7
|
+
BrazeRuby::REST::EmailUnsubscribes.new(api_key, braze_url, options, **payload).perform
|
8
8
|
end
|
9
9
|
|
10
10
|
def email_hard_bounces(**payload)
|
11
|
-
BrazeRuby::REST::EmailHardBounces.new(api_key, braze_url, payload).perform
|
11
|
+
BrazeRuby::REST::EmailHardBounces.new(api_key, braze_url, options, **payload).perform
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -6,13 +6,13 @@ module BrazeRuby
|
|
6
6
|
attr_writer :identify_users_service
|
7
7
|
|
8
8
|
def identify_users(**payload)
|
9
|
-
identify_users_service.perform(
|
9
|
+
identify_users_service.perform(**payload)
|
10
10
|
end
|
11
11
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def identify_users_service
|
15
|
-
@identify_users_service ||= BrazeRuby::REST::IdentifyUsers.new(braze_url)
|
15
|
+
@identify_users_service ||= BrazeRuby::REST::IdentifyUsers.new(api_key, braze_url, options)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BrazeRuby
|
4
|
+
module Endpoints
|
5
|
+
module RemoveExternalIds
|
6
|
+
attr_writer :remove_external_ids_service
|
7
|
+
|
8
|
+
def remove_external_ids(payload)
|
9
|
+
remove_external_ids_service.perform(external_ids: payload[:external_ids])
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def remove_external_ids_service
|
15
|
+
@remove_external_ids ||= BrazeRuby::REST::RemoveExternalIds.new(api_key, braze_url, options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BrazeRuby
|
4
|
+
module Endpoints
|
5
|
+
module RenameExternalIds
|
6
|
+
attr_writer :rename_external_ids_service
|
7
|
+
|
8
|
+
def rename_external_ids(payload)
|
9
|
+
rename_external_ids_service.perform(external_id_renames: payload[:external_id_renames])
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def rename_external_ids_service
|
15
|
+
@rename_external_ids ||= BrazeRuby::REST::RenameExternalIds.new(api_key, braze_url, options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -4,16 +4,15 @@ module BrazeRuby
|
|
4
4
|
module Endpoints
|
5
5
|
module Subscription
|
6
6
|
def subscription_status_set(**payload)
|
7
|
-
BrazeRuby::REST::SubscriptionStatusSet.new(api_key, braze_url, payload).perform
|
7
|
+
BrazeRuby::REST::SubscriptionStatusSet.new(api_key, braze_url, options, **payload).perform
|
8
8
|
end
|
9
9
|
|
10
10
|
def subscription_status_get(**payload)
|
11
|
-
BrazeRuby::REST::SubscriptionStatusGet.new(api_key, braze_url, payload).perform
|
11
|
+
BrazeRuby::REST::SubscriptionStatusGet.new(api_key, braze_url, options, **payload).perform
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
14
|
def subscription_user_status(**payload)
|
16
|
-
BrazeRuby::REST::SubscriptionUserStatus.new(api_key, braze_url, payload).perform
|
15
|
+
BrazeRuby::REST::SubscriptionUserStatus.new(api_key, braze_url, options, **payload).perform
|
17
16
|
end
|
18
17
|
end
|
19
18
|
end
|
@@ -6,25 +6,25 @@ module BrazeRuby
|
|
6
6
|
attr_writer :track_users_service
|
7
7
|
|
8
8
|
def track_users(**payload)
|
9
|
-
track_users_service.perform(
|
9
|
+
track_users_service.perform(**payload)
|
10
10
|
end
|
11
11
|
|
12
|
-
def track_purchase(payload)
|
12
|
+
def track_purchase(**payload)
|
13
13
|
track_users(purchases: [payload])
|
14
14
|
end
|
15
15
|
|
16
|
-
def track_event(payload)
|
16
|
+
def track_event(**payload)
|
17
17
|
track_users(events: [payload])
|
18
18
|
end
|
19
19
|
|
20
|
-
def track_attribute(payload)
|
20
|
+
def track_attribute(**payload)
|
21
21
|
track_users(attributes: [payload])
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def track_users_service
|
27
|
-
@track_users_service ||= BrazeRuby::REST::TrackUsers.new(braze_url)
|
27
|
+
@track_users_service ||= BrazeRuby::REST::TrackUsers.new(api_key, braze_url, options)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
data/lib/braze_ruby/http.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "json"
|
4
|
+
require "faraday"
|
5
5
|
|
6
6
|
module BrazeRuby
|
7
7
|
class HTTP
|
8
|
-
|
8
|
+
DEFAULT_TIMEOUT = 30
|
9
|
+
|
10
|
+
def initialize(api_key, braze_url, options = {})
|
11
|
+
@api_key = api_key
|
9
12
|
@braze_url = braze_url
|
13
|
+
@options = default_options.merge(options)
|
10
14
|
end
|
11
15
|
|
12
16
|
def post(path, payload)
|
@@ -15,20 +19,29 @@ module BrazeRuby
|
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
18
|
-
def get(path, query)
|
22
|
+
def get(path, query = {})
|
19
23
|
connection.get path, query
|
20
24
|
end
|
21
25
|
|
22
26
|
def connection
|
23
27
|
@connection ||= Faraday.new(url: @braze_url) do |connection|
|
24
|
-
connection.headers[
|
25
|
-
connection.headers[
|
26
|
-
connection.headers[
|
28
|
+
connection.headers["Content-Type"] = "application/json"
|
29
|
+
connection.headers["Accept"] = "application/json"
|
30
|
+
connection.headers["User-Agent"] = "Braze Ruby gem v#{BrazeRuby::VERSION}"
|
31
|
+
connection.headers["Authorization"] = "Bearer #{@api_key}"
|
27
32
|
|
28
|
-
connection.response :logger if ENV[
|
33
|
+
connection.response :logger if ENV["BRAZE_RUBY_DEBUG"]
|
29
34
|
|
30
35
|
connection.adapter Faraday.default_adapter
|
36
|
+
|
37
|
+
connection.options[:timeout] = @options[:timeout]
|
31
38
|
end
|
32
39
|
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def default_options
|
44
|
+
{timeout: DEFAULT_TIMEOUT}
|
45
|
+
end
|
33
46
|
end
|
34
47
|
end
|
data/lib/braze_ruby/rest.rb
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
17
|
-
require
|
18
|
-
require
|
19
|
-
require
|
3
|
+
require "braze_ruby/rest/base"
|
4
|
+
require "braze_ruby/rest/track_users"
|
5
|
+
require "braze_ruby/rest/send_messages"
|
6
|
+
require "braze_ruby/rest/schedule_messages"
|
7
|
+
require "braze_ruby/rest/email_status"
|
8
|
+
require "braze_ruby/rest/email_hard_bounces"
|
9
|
+
require "braze_ruby/rest/email_unsubscribes"
|
10
|
+
require "braze_ruby/rest/export_users"
|
11
|
+
require "braze_ruby/rest/list_segments"
|
12
|
+
require "braze_ruby/rest/delete_users"
|
13
|
+
require "braze_ruby/rest/trigger_campaign_send"
|
14
|
+
require "braze_ruby/rest/trigger_canvas_send"
|
15
|
+
require "braze_ruby/rest/canvas_details"
|
16
|
+
require "braze_ruby/rest/subscription_status_set"
|
17
|
+
require "braze_ruby/rest/subscription_status_get"
|
18
|
+
require "braze_ruby/rest/subscription_user_status"
|
19
|
+
require "braze_ruby/rest/identify_users"
|
20
|
+
require "braze_ruby/rest/create_user_aliases"
|
21
|
+
require "braze_ruby/rest/rename_external_ids"
|
22
|
+
require "braze_ruby/rest/remove_external_ids"
|
data/lib/braze_ruby/rest/base.rb
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "braze_ruby/http"
|
4
4
|
|
5
5
|
module BrazeRuby
|
6
6
|
module REST
|
7
7
|
class Base
|
8
8
|
attr_writer :http
|
9
9
|
|
10
|
-
def initialize(braze_url)
|
10
|
+
def initialize(api_key, braze_url, options)
|
11
|
+
@api_key = api_key
|
11
12
|
@braze_url = braze_url
|
13
|
+
@options = options
|
12
14
|
end
|
13
15
|
|
14
16
|
private
|
15
17
|
|
16
18
|
def http
|
17
|
-
@http ||= BrazeRuby::HTTP.new(@braze_url)
|
19
|
+
@http ||= BrazeRuby::HTTP.new(@api_key, @braze_url, @options)
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -3,17 +3,15 @@
|
|
3
3
|
module BrazeRuby
|
4
4
|
module REST
|
5
5
|
class CanvasDetails < Base
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :params
|
7
7
|
|
8
|
-
def initialize(api_key, braze_url, **params)
|
9
|
-
@api_key = api_key
|
8
|
+
def initialize(api_key, braze_url, options, **params)
|
10
9
|
@params = params
|
11
|
-
super braze_url
|
10
|
+
super api_key, braze_url, options
|
12
11
|
end
|
13
12
|
|
14
13
|
def perform
|
15
|
-
http.get(
|
16
|
-
'api_key': api_key,
|
14
|
+
http.get("/canvas/details", {
|
17
15
|
**@params
|
18
16
|
})
|
19
17
|
end
|
@@ -3,10 +3,9 @@
|
|
3
3
|
module BrazeRuby
|
4
4
|
module REST
|
5
5
|
class DeleteUsers < Base
|
6
|
-
def perform(
|
7
|
-
http.post
|
8
|
-
|
9
|
-
'external_ids': external_ids
|
6
|
+
def perform(external_ids: [])
|
7
|
+
http.post "/users/delete", {
|
8
|
+
external_ids: external_ids
|
10
9
|
}
|
11
10
|
end
|
12
11
|
end
|
@@ -3,17 +3,15 @@
|
|
3
3
|
module BrazeRuby
|
4
4
|
module REST
|
5
5
|
class EmailHardBounces < Base
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :params
|
7
7
|
|
8
|
-
def initialize(api_key, braze_url, **params)
|
9
|
-
@api_key = api_key
|
8
|
+
def initialize(api_key, braze_url, options, **params)
|
10
9
|
@params = params
|
11
|
-
super braze_url
|
10
|
+
super api_key, braze_url, options
|
12
11
|
end
|
13
12
|
|
14
13
|
def perform
|
15
|
-
http.get(
|
16
|
-
'api_key': api_key,
|
14
|
+
http.get("/email/hard_bounces", {
|
17
15
|
**@params
|
18
16
|
})
|
19
17
|
end
|
@@ -3,20 +3,18 @@
|
|
3
3
|
module BrazeRuby
|
4
4
|
module REST
|
5
5
|
class EmailStatus < Base
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :email, :status
|
7
7
|
|
8
|
-
def initialize(api_key, braze_url, email: nil, status: nil)
|
9
|
-
@api_key = api_key
|
8
|
+
def initialize(api_key, braze_url, options, email: nil, status: nil)
|
10
9
|
@email = email
|
11
10
|
@status = status
|
12
|
-
super braze_url
|
11
|
+
super api_key, braze_url, options
|
13
12
|
end
|
14
13
|
|
15
14
|
def perform
|
16
|
-
http.post
|
17
|
-
|
18
|
-
|
19
|
-
'subscription_state': status
|
15
|
+
http.post "/email/status", {
|
16
|
+
email: email,
|
17
|
+
subscription_state: status
|
20
18
|
}
|
21
19
|
end
|
22
20
|
end
|