Skip to content

Commit

Permalink
Clean up some name changes in the example code on readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeckennedy committed Jan 21, 2024
1 parent 6e18f5c commit bfb303c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -33,15 +33,15 @@ 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?
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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -81,8 +81,6 @@ status: bool = listmonk.send_transactional_email(
template_data=template_data, content_type='html')
```



## Want to contribute?

PRs are welcome. Enjoy.

0 comments on commit bfb303c

Please sign in to comment.