66listId = 'YOUR_LIST_ID'
77emailAddress = '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+
916subscriber = Subscriber (auth , listId , emailAddress )
1017
1118# Get the details for a subscriber
1219subscriberDetail = subscriber .get ()
1320for property , value in vars (subscriberDetail ).items ():
1421 print (property , ":" , value )
22+
23+ # Adding a subscriber
24+ #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+ #This implemntation defaults the value of 'restart_subscription_based_autoresponders' to false
29+ #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+ # 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 )
0 commit comments