@@ -22,7 +22,7 @@ class Subscriber(CreateSendBase):
2222* * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * (list_id or self .list_id ), params = params )
2323** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * return json_to_py (response )
2424
25- ** * REMOVED ** * * * * REMOVED ** * def add (self , list_id , email_address , name , custom_fields , resubscribe , consent_to_track , restart_subscription_based_autoresponders = False ):
25+ ** * REMOVED ** * * * * REMOVED ** * def add (self , list_id , email_address , name , custom_fields , resubscribe , consent_to_track , restart_subscription_based_autoresponders = False , mobile_number = False , consent_to_track_sms = "Unchanged" ):
2626** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * """Adds a subscriber to a subscriber list."""
2727** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * validate_consent_to_track (consent_to_track )
2828** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * body = {
@@ -32,11 +32,16 @@ class Subscriber(CreateSendBase):
3232** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * "Resubscribe" : resubscribe ,
3333** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * "ConsentToTrack" : consent_to_track ,
3434** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * "RestartSubscriptionBasedAutoresponders" : restart_subscription_based_autoresponders }
35+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** *
36+ * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * if mobile_number :
37+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * body ["MobileNumber" ] = mobile_number
38+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * body ["ConsentToSendSms" ] = consent_to_track_sms
39+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** *
3540* * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * response = self ._post ("/subscribers/%s.json" %
3641* * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * list_id , json .dumps (body ))
3742** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * return json_to_py (response )
3843
39- ** * REMOVED ** * * * * REMOVED ** * def update (self , new_email_address , name , custom_fields , resubscribe , consent_to_track , restart_subscription_based_autoresponders = False ):
44+ ** * REMOVED ** * * * * REMOVED ** * def update (self , new_email_address , name , custom_fields , resubscribe , consent_to_track , restart_subscription_based_autoresponders = False , mobile_number = False , consent_to_track_sms = "Unchanged" ):
4045** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * """Updates any aspect of a subscriber, including email address, name, and
4146***REMOVED******REMOVED******REMOVED******REMOVED***custom field data if supplied."""
4247** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * validate_consent_to_track (consent_to_track )
@@ -48,6 +53,12 @@ class Subscriber(CreateSendBase):
4853** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * "Resubscribe" : resubscribe ,
4954** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * "ConsentToTrack" : consent_to_track ,
5055** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * "RestartSubscriptionBasedAutoresponders" : restart_subscription_based_autoresponders }
56+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** *
57+ * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * if mobile_number :
58+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * body ["MobileNumber" ] = mobile_number
59+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * body ["ConsentToSendSms" ] = consent_to_track_sms
60+
61+ ** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** *
5162* * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * response = self ._put ("/subscribers/%s.json" % self .list_id ,
5263** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * body = json .dumps (body ), params = params )
5364** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * # Update self.email_address, so this object can continue to be used
@@ -93,4 +104,4 @@ class Subscriber(CreateSendBase):
93104** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * """Moves this subscriber to the deleted state in the associated list."""
94105** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * params = {"email" : self .email_address }
95106** * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * response = self ._delete ("/subscribers/%s.json" %
96- * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * self .list_id , params = params )
107+ * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * * * * REMOVED ** * self .list_id , params = params )
0 commit comments