-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update examples in subscribers.py file
- Loading branch information
1 parent
94f08b2
commit 12ec70f
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import sys | ||
import os | ||
|
||
# Add the lib folder to sys.path | ||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib'))) | ||
|
||
from createsend import * | ||
|
||
key = 'MYSLlg+WX4DJqDPS6MwYqADJPsyg/EYGnhoBZ8SI4jrBB/3Ixp2WyQnkU507919NyVCszZnBygWIk1wlpVSopm9ePqtmAdzjOnr9EDvbwm+JZRgEybIZ8rrU34P6aH+3wjYVGD0mPv1/j3HAYrnvgg==' | ||
|
||
cs = CreateSend({'api_key': key}) | ||
clients = cs.clients() | ||
|
||
for cl in clients: | ||
print("Client: %s" % cl.ClientID + " " + cl.Name) | ||
smsClient = Client({'api_key': key}, cl.ClientID) | ||
|
||
for list in smsClient.lists(): | ||
if(list.Name == "Alexis' Experimental List"): | ||
print(list.Name) | ||
testList = List({'api_key': key}, list.ListID) | ||
break | ||
|
||
for subs in testList.active().Results: | ||
print(subs.Name) | ||
|
||
testSubscriber = Subscriber({'api_key': key}, None, "[email protected]") | ||
testSubscriber.add(testList.list_id, "[email protected]", "Morning8", [], True, 'Unchanged', mobile_number="+61491570123", consent_to_track_sms="Yes" ) | ||
# # testSubscriber.add(testList.list_id, "[email protected]", "Joe Joe", [], "yes", "yes")1 | ||
# # .add( | ||
|
||
# testSubscriber = Subscriber.({'api_key': key}, testList.list_id, "[email protected]") | ||
# testSubscriber.update("[email protected]", "UpdateTest", [], True, "Unchanged", False, "+6140899111") | ||
|
||
subscriber = Subscriber({'api_key': key}, testList.list_id, "[email protected]") | ||
|
||
subscriberDetail = subscriber.get() | ||
for property, value in vars(subscriberDetail).items(): | ||
print(property, ":", value) |