From bfb303c32dd42dff9f51eb90229e804cb9701be7 Mon Sep 17 00:00:00 2001 From: Michael Kennedy Date: Sun, 21 Jan 2024 09:06:30 -0800 Subject: [PATCH] Clean up some name changes in the example code on readme. --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e7046e3..901c2f4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ So while it doesn't currently cover every endpoint (for example you cannot creat * 👥 Retrieve your **segmentation lists**, list details, and subscribers. * 🙅 Unsubscribe and block users who don't want to be contacted further. * 💥 Completely delete a subscriber from your instance. -* 📧 Send transactional email with template data (i.e. password reset emails). +* 📧 Send transactional email with template data (e.g. password reset emails). ## Installation @@ -33,7 +33,7 @@ Just `pip install listmonk` import listmonk listmonk.set_url_base('https://yourlistmonkurl.com') -listmonk.login('sammyz', '1234') +listmonk.login('sammy_z', '1234') valid: bool = listmonk.verify_login() # Is it alive and working? @@ -41,7 +41,7 @@ up: bool = listmonk.is_healthy() # Read data about your lists lists: list[] = listmonk.lists() -list: MailingList = listmonk.list(list_id=7) +list: MailingList = listmonk.list_by_id(list_id=7) # Various ways to access existing subscribers subscribers: list[] = listmonk.subscribers(list_id=9) @@ -53,12 +53,12 @@ subscriber: Subscriber = listmonk.subscriber_by_uuid('f6668cf0-1c...') # Create a new subscriber new_subscriber = listmonk.create_subscriber( 'testuser@some.domain', 'Jane Doe', - [1, 7, 9], pre_confirm=True, attribs={...} ) + {1, 7, 9}, pre_confirm=True, attribs={...} ) # Change the email, custom rating, and add to lists 4 & 6, remove from 5. subscriber.email = 'newemail@some.domain' subscriber.attribs['rating'] = 7 -updated_subscriber = listmonk.update_subscriber(new_subscriber, {4, 6}, {5}) +updated_subscriber = listmonk.update_subscriber(subscriber, {4, 6}, {5}) # Disable then re-enable a subscriber subscriber = listmonk.disable_subscriber(subscriber) @@ -70,7 +70,7 @@ listmonk.block_subscriber(subscriber) # Fully delete them from your system listmonk.delete_subscriber(subscriber.email) -# Send an individual, transacational email (e.g. password reset) +# Send an individual, transactional email (e.g. password reset) to_email = 'testuser@some.domain' from_email = 'app@your.domain' template_id = 3 # *TX* template ID from listmonk @@ -81,8 +81,6 @@ status: bool = listmonk.send_transactional_email( template_data=template_data, content_type='html') ``` - - ## Want to contribute? PRs are welcome. Enjoy.