Skip to content

Commit

Permalink
Update examples in subscribers.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisT-CM committed Jan 23, 2025
1 parent 4f06f07 commit 556cc36
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
20 changes: 20 additions & 0 deletions samples/subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,29 @@
listId = 'YOUR_LIST_ID'
emailAddress = 'YOUR_SUBSCRIBER_EMAIL_ADDRESS'

subscriberName = "YOUR_SUBSCRIBER_NAME"
subscriberCustomFields = []
subscriberResubscribed = False
subscriberConsentToTrack = 'Unchanged'
subscriberMobileNumber = "+61491570006" # This is a reserved mobile number by the Australian Communications and Media Authority
subscriberConsentToSendSms = "Yes"

subscriber = Subscriber(auth, listId, emailAddress)

# Get the details for a subscriber
***REMOVED***
***REMOVED***
***REMOVED***print(property, ":", value)
***REMOVED***
# Adding a subscriber
***REMOVED***#This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
subscriber.add(listId, emailAddress, subscriberName, subscriberCustomFields, subscriberResubscribed, subscriberConsentToTrack)

# Adding a subscriber with a mobile number
***REMOVED***#This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
***REMOVED***#This also sets the default value of 'consent_to_track_sms' to 'unchanged', meaning new users will not receive SMS communications by default."
subscriber.add(listId, emailAddress, subscriberName, subscriberCustomFields, subscriberConsentToTrack, mobile_Number=subscriberMobileNumber)

#Alternative to set SMS tracking permissions
***REMOVED***# This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
subscriber.add(listId, emailAddress, subscriberName, subscriberCustomFields, subscriberConsentToTrack, mobile_Number=subscriberMobileNumber, consent_to_track_sms=subscriberConsentToSendSms)
39 changes: 39 additions & 0 deletions samples/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
***REMOVED***
***REMOVED***

***REMOVED***
***REMOVED***

***REMOVED***

***REMOVED***

***REMOVED***
***REMOVED***

***REMOVED***
***REMOVED***
***REMOVED***

***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***
***REMOVED***

testSubscriber =***REMOVED***Subscriber({'api_key': key}, None, "[email protected]")
***REMOVED***
***REMOVED***
***REMOVED***

# testSubscriber =***REMOVED***Subscriber.({'api_key': key}, testList.list_id, "[email protected]")
***REMOVED***

***REMOVED***

***REMOVED***
***REMOVED***
***REMOVED***print(property, ":", value)

0 comments on commit 556cc36

Please sign in to comment.