Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
adding set subscription group method (#14)
Browse files Browse the repository at this point in the history
* adding set subscription group method 

extending the functionality here to allow customers to set a subscription group ID

* Update braze-templates/4-sms-capture-modal/index.html

Co-authored-by: davidbielik <[email protected]>

* Update README.md

Co-authored-by: davidbielik <[email protected]>
  • Loading branch information
nickrobin and davidbielik authored Dec 9, 2021
1 parent a83f3b3 commit 37ac0ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions braze-templates/4-sms-capture-modal/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> ⚠️ Note: Subscription Groups were introduced in Android SDK v15.0.0, Web SDK v3.4.0, and iOS SDK v4.3.3. Please ensure your SDKs are up to date, or apply filters to your message's targeting.
<img alt="screenshot" src="screenshot.gif" height="500"/>

* Supports multiple country codes and validation
Expand Down
3 changes: 3 additions & 0 deletions braze-templates/4-sms-capture-modal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[ ] Upload and swap out all images (eg: https://via.placeholder.com/450 -> your new image URL)
[ ] Change the `href="#"` to `href="https://your-link" or `href="your://deeplink"`
[ ] Change button text
[ ] Set the variable subscriptionGroupId as your target Subscription Group ID
-->

<!-- phone input -->
Expand Down Expand Up @@ -571,6 +572,7 @@ <h1 class="modal__title">Thanks for signing up!</h1>
});
</script>
<script>
var subscriptionGroupId = "ENTER YOUR SUBSCRIPTION GROUP ID FOUND IN DASHBOARD";
var input = document.getElementById("phone");
var error = document.getElementById("error");
var optin = document.getElementById("optin");
Expand Down Expand Up @@ -627,6 +629,7 @@ <h1 class="modal__title">Thanks for signing up!</h1>
}
var number = iti.getNumber();
appboyBridge.getUser().setPhoneNumber(number);
appboyBridge.getUser().addToSubscriptionGroup(subscriptionGroupId);
appboyBridge.logClick('added phone number');
appboyBridge.requestImmediateDataFlush();
form.style.display = 'none';
Expand Down

0 comments on commit 37ac0ff

Please sign in to comment.