Skip to content

Commit f4e3b8b

Browse files
committed
Update examples in subscribers.py file
1 parent 4f06f07 commit f4e3b8b

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

samples/subscribers.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,29 @@
66
listId = 'YOUR_LIST_ID'
77
emailAddress = 'YOUR_SUBSCRIBER_EMAIL_ADDRESS'
88

9+
subscriberName = "YOUR_SUBSCRIBER_NAME"
10+
subscriberCustomFields = []
11+
subscriberResubscribed = False
12+
subscriberConsentToTrack = 'Unchanged'
13+
subscriberMobileNumber = "+61491570006" # This is a reserved mobile number by the Australian Communications and Media Authority
14+
subscriberConsentToSendSms = "Yes"
15+
916
subscriber = Subscriber(auth, listId, emailAddress)
1017

1118
# Get the details for a subscriber
1219
***REMOVED***
1320
***REMOVED***
1421
***REMOVED***print(property, ":", value)
22+
***REMOVED***
23+
# Adding a subscriber
24+
***REMOVED***#This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
25+
subscriber.add(listId, emailAddress, subscriberName, subscriberCustomFields, subscriberResubscribed, subscriberConsentToTrack)
26+
27+
# Adding a subscriber with a mobile number
28+
***REMOVED***#This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
29+
***REMOVED***#This also sets the default value of 'consent_to_track_sms' to 'unchanged', meaning new users will not receive SMS communications by default."
30+
subscriber.add(listId, emailAddress, subscriberName, subscriberCustomFields, subscriberConsentToTrack, mobile_Number=subscriberMobileNumber)
31+
32+
#Alternative to set SMS tracking permissions
33+
***REMOVED***# This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
34+
subscriber.add(listId, emailAddress, subscriberName, subscriberCustomFields, subscriberConsentToTrack, mobile_Number=subscriberMobileNumber, consent_to_track_sms=subscriberConsentToSendSms)

samples/test.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
***REMOVED***
2+
***REMOVED***
3+
4+
***REMOVED***
5+
***REMOVED***
6+
7+
***REMOVED***
8+
9+
***REMOVED***
10+
11+
***REMOVED***
12+
***REMOVED***
13+
14+
***REMOVED***
15+
***REMOVED***
16+
***REMOVED***
17+
18+
***REMOVED***
19+
***REMOVED***
20+
***REMOVED***
21+
***REMOVED***
22+
***REMOVED***
23+
***REMOVED***
24+
***REMOVED***
25+
***REMOVED***print(subs.Name)
26+
27+
testSubscriber =***REMOVED***Subscriber({'api_key': key}, None, "[email protected]")
28+
***REMOVED***
29+
***REMOVED***
30+
***REMOVED***
31+
32+
# testSubscriber =***REMOVED***Subscriber.({'api_key': key}, testList.list_id, "[email protected]")
33+
***REMOVED***
34+
35+
***REMOVED***
36+
37+
***REMOVED***
38+
***REMOVED***
39+
***REMOVED***print(property, ":", value)

0 commit comments

Comments
 (0)