Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
with:
# SDK Server Project
project-url: https://github.com/orgs/OneSignal/projects/11
github-token: ${{ secrets.GH_PROJECTS_TOKEN }}
github-token: ${{ secrets.GH_PUSH_TOKEN }}
2 changes: 2 additions & 0 deletions docs/BasicNotification.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
| **email_preheader** | **String** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional] |
| **disable_email_click_tracking** | **Boolean** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional] |
| **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] |
| **email_bcc** | **Array<String>** | Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] |
| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] |
| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] |
| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] |
Expand Down Expand Up @@ -230,6 +231,7 @@ instance = OneSignal::BasicNotification.new(
email_preheader: null,
disable_email_click_tracking: null,
include_unsubscribed: null,
email_bcc: null,
sms_from: null,
sms_media_urls: null,
filters: null,
Expand Down
2 changes: 2 additions & 0 deletions docs/BasicNotificationAllOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
| **email_preheader** | **String** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional] |
| **disable_email_click_tracking** | **Boolean** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional] |
| **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] |
| **email_bcc** | **Array<String>** | Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] |
| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] |
| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] |
| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] |
Expand Down Expand Up @@ -204,6 +205,7 @@ instance = OneSignal::BasicNotificationAllOf.new(
email_preheader: null,
disable_email_click_tracking: null,
include_unsubscribed: null,
email_bcc: null,
sms_from: null,
sms_media_urls: null,
filters: null,
Expand Down
2 changes: 2 additions & 0 deletions docs/CreateTemplateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| **is_email** | **Boolean** | Set true for an Email template. | [optional] |
| **email_subject** | **String** | Subject of the email. | [optional] |
| **email_body** | **String** | Body of the email (HTML supported). | [optional] |
| **email_bcc** | **Array<String>** | BCC recipients for the email template. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] |
| **is_sms** | **Boolean** | Set true for an SMS template. | [optional] |
| **dynamic_content** | **String** | JSON string for dynamic content personalization. | [optional] |

Expand All @@ -29,6 +30,7 @@ instance = OneSignal::CreateTemplateRequest.new(
is_email: null,
email_subject: null,
email_body: null,
email_bcc: null,
is_sms: null,
dynamic_content: null
)
Expand Down
2 changes: 2 additions & 0 deletions docs/Notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
| **email_preheader** | **String** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional] |
| **disable_email_click_tracking** | **Boolean** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional] |
| **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] |
| **email_bcc** | **Array<String>** | Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] |
| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] |
| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] |
| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] |
Expand Down Expand Up @@ -231,6 +232,7 @@ instance = OneSignal::Notification.new(
email_preheader: null,
disable_email_click_tracking: null,
include_unsubscribed: null,
email_bcc: null,
sms_from: null,
sms_media_urls: null,
filters: null,
Expand Down
6 changes: 5 additions & 1 deletion docs/NotificationWithMeta.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
| **email_preheader** | **String** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional] |
| **disable_email_click_tracking** | **Boolean** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional] |
| **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] |
| **email_bcc** | **Array<String>** | BCC recipients that were set on this email notification. | [optional] |
| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] |
| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] |
| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] |
Expand All @@ -130,6 +131,7 @@
| **completed_at** | **Integer** | Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after. | [optional] |
| **platform_delivery_stats** | [**PlatformDeliveryData**](PlatformDeliveryData.md) | | [optional] |
| **canceled** | **Boolean** | Indicates whether the notification was canceled before it could be sent. | [optional] |
| **bcc_sent** | **Integer** | Number of BCC copies successfully sent for this notification. | [optional] |

## Example

Expand Down Expand Up @@ -242,6 +244,7 @@ instance = OneSignal::NotificationWithMeta.new(
email_preheader: null,
disable_email_click_tracking: null,
include_unsubscribed: null,
email_bcc: null,
sms_from: null,
sms_media_urls: null,
filters: null,
Expand All @@ -262,7 +265,8 @@ instance = OneSignal::NotificationWithMeta.new(
send_after: null,
completed_at: null,
platform_delivery_stats: null,
canceled: null
canceled: null,
bcc_sent: null
)
```

6 changes: 5 additions & 1 deletion docs/NotificationWithMetaAllOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
| **received** | **Integer** | Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0. | [optional] |
| **throttle_rate_per_minute** | **Integer** | number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details. | [optional] |
| **canceled** | **Boolean** | Indicates whether the notification was canceled before it could be sent. | [optional] |
| **email_bcc** | **Array<String>** | BCC recipients that were set on this email notification. | [optional] |
| **bcc_sent** | **Integer** | Number of BCC copies successfully sent for this notification. | [optional] |

## Example

Expand All @@ -34,7 +36,9 @@ instance = OneSignal::NotificationWithMetaAllOf.new(
platform_delivery_stats: null,
received: null,
throttle_rate_per_minute: null,
canceled: null
canceled: null,
email_bcc: null,
bcc_sent: null
)
```

2 changes: 2 additions & 0 deletions docs/UpdateTemplateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| **is_email** | **Boolean** | Set true for an Email template. | [optional] |
| **email_subject** | **String** | Subject of the email. | [optional] |
| **email_body** | **String** | Body of the email (HTML supported). | [optional] |
| **email_bcc** | **Array<String>** | BCC recipients for the email template. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] |
| **is_sms** | **Boolean** | Set true for an SMS template. | [optional] |
| **dynamic_content** | **String** | JSON string for dynamic content personalization. | [optional] |

Expand All @@ -27,6 +28,7 @@ instance = OneSignal::UpdateTemplateRequest.new(
is_email: null,
email_subject: null,
email_body: null,
email_bcc: null,
is_sms: null,
dynamic_content: null
)
Expand Down
30 changes: 29 additions & 1 deletion lib/onesignal/models/basic_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ class BasicNotification
# Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared.
attr_accessor :include_unsubscribed

# Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email.
attr_accessor :email_bcc

# Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.
attr_accessor :sms_from

Expand Down Expand Up @@ -478,6 +481,7 @@ def self.attribute_map
:'email_preheader' => :'email_preheader',
:'disable_email_click_tracking' => :'disable_email_click_tracking',
:'include_unsubscribed' => :'include_unsubscribed',
:'email_bcc' => :'email_bcc',
:'sms_from' => :'sms_from',
:'sms_media_urls' => :'sms_media_urls',
:'filters' => :'filters',
Expand Down Expand Up @@ -603,6 +607,7 @@ def self.openapi_types
:'email_preheader' => :'String',
:'disable_email_click_tracking' => :'Boolean',
:'include_unsubscribed' => :'Boolean',
:'email_bcc' => :'Array<String>',
:'sms_from' => :'String',
:'sms_media_urls' => :'Array<String>',
:'filters' => :'Array<FilterExpression>',
Expand Down Expand Up @@ -700,6 +705,7 @@ def self.openapi_nullable
:'email_reply_to_address',
:'email_preheader',
:'disable_email_click_tracking',
:'email_bcc',
:'sms_from',
:'sms_media_urls',
:'filters',
Expand Down Expand Up @@ -1183,6 +1189,12 @@ def initialize(attributes = {})
self.include_unsubscribed = attributes[:'include_unsubscribed']
end

if attributes.key?(:'email_bcc')
if (value = attributes[:'email_bcc']).is_a?(Array)
self.email_bcc = value
end
end

if attributes.key?(:'sms_from')
self.sms_from = attributes[:'sms_from']
end
Expand Down Expand Up @@ -1232,6 +1244,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
end

if !@email_bcc.nil? && @email_bcc.length > 5
invalid_properties.push('invalid value for "email_bcc", number of items must be less than or equal to 5.')
end

invalid_properties
end

Expand All @@ -1243,6 +1259,7 @@ def valid?
aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"])
return false unless aggregation_validator.valid?(@aggregation)
return false if @app_id.nil?
return false if !@email_bcc.nil? && @email_bcc.length > 5
huawei_category_validator = EnumAttributeValidator.new('String', ["IM", "VOIP", "SUBSCRIPTION", "TRAVEL", "HEALTH", "WORK", "ACCOUNT", "EXPRESS", "FINANCE", "DEVICE_REMINDER", "MAIL", "MARKETING"])
return false unless huawei_category_validator.valid?(@huawei_category)
true
Expand All @@ -1268,6 +1285,16 @@ def aggregation=(aggregation)
@aggregation = aggregation
end

# Custom attribute writer method with validation
# @param [Object] email_bcc Value to be assigned
def email_bcc=(email_bcc)
if !email_bcc.nil? && email_bcc.length > 5
fail ArgumentError, 'invalid value for "email_bcc", number of items must be less than or equal to 5.'
end

@email_bcc = email_bcc
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] huawei_category Object to be assigned
def huawei_category=(huawei_category)
Expand Down Expand Up @@ -1388,6 +1415,7 @@ def ==(o)
email_preheader == o.email_preheader &&
disable_email_click_tracking == o.disable_email_click_tracking &&
include_unsubscribed == o.include_unsubscribed &&
email_bcc == o.email_bcc &&
sms_from == o.sms_from &&
sms_media_urls == o.sms_media_urls &&
filters == o.filters &&
Expand All @@ -1408,7 +1436,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[included_segments, excluded_segments, include_subscription_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, app_id, external_id, idempotency_key, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, ios_relevance_score, ios_interruption_level, email_subject, email_body, email_from_name, email_from_address, email_reply_to_address, email_preheader, disable_email_click_tracking, include_unsubscribed, sms_from, sms_media_urls, filters, custom_data, huawei_badge_class, huawei_badge_add_num, huawei_badge_set_num, huawei_category, huawei_bi_tag].hash
[included_segments, excluded_segments, include_subscription_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, app_id, external_id, idempotency_key, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, ios_relevance_score, ios_interruption_level, email_subject, email_body, email_from_name, email_from_address, email_reply_to_address, email_preheader, disable_email_click_tracking, include_unsubscribed, email_bcc, sms_from, sms_media_urls, filters, custom_data, huawei_badge_class, huawei_badge_add_num, huawei_badge_set_num, huawei_category, huawei_bi_tag].hash
end

# Builds the object from hash
Expand Down
Loading
Loading