-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jg-add-trigger-broadcast-request
- Loading branch information
Showing
7 changed files
with
186 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Customerio | ||
class SendPushRequest | ||
attr_reader :message | ||
|
||
def initialize(opts) | ||
@message = opts.delete_if { |field| invalid_field?(field) } | ||
@message[:custom_device] = opts[:device] if opts[:device] | ||
end | ||
|
||
private | ||
|
||
REQUIRED_FIELDS = %i(transactional_message_id identifiers) | ||
|
||
OPTIONAL_FIELDS = %i( | ||
to | ||
title | ||
message | ||
disable_message_retention | ||
send_to_unsubscribed | ||
queue_draft | ||
message_data | ||
send_at | ||
language | ||
image_url | ||
link | ||
sound | ||
custom_data | ||
device | ||
custom_device | ||
) | ||
|
||
def invalid_field?(field) | ||
!REQUIRED_FIELDS.include?(field) && !OPTIONAL_FIELDS.include?(field) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Customerio | ||
VERSION = "5.0.0" | ||
VERSION = "5.1.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters