Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yournotify Python

Python SDK for the current Yournotify API.

Install

pip install yournotify-python

Quickstart

from yournotify import Yournotify, YournotifyApiError

client = Yournotify("YOURNOTIFY_API_KEY")

try:
	client.validate_auth()
	client.send_email(
		"Welcome campaign",
		"Welcome",
		"<p>Hello</p>",
		"Hello",
		"draft",
		"noreply@smtp.yournotify.net",
		[{"email": "person@example.com", "name": "Person"}],
	)
except YournotifyApiError as exc:
	print(exc.status_code, exc.body)

Campaigns

client.create_campaign({"name": "WhatsApp", "channel": "whatsapp", "template_id": "template_123"})
client.send_sms("SMS", "YTAuth", "Hello", "draft", [{"telephone": "+2348100000000"}])
client.send_whatsapp({"name": "WhatsApp", "template_id": "template_123"})
client.send_push({"name": "Push", "title": "Hello", "body": "Welcome"})
client.send_in_app({"name": "In-app", "title": "Hello", "body": "Welcome"})
client.test_campaign({"channel": "email", "email": "person@example.com"})

Contacts, Lists, Rewards, Automation

client.add_contact("person@example.com", "+2348100000000", [123], "Person", {"source": "python"})
client.get_contacts({"page": 1})
client.add_list("Newsletter", "public", "single")

client.create_reward({"name": "Referral reward"})
client.send_reward({"reward_id": 123, "email": "person@example.com"})

client.identify({"external_id": "user_123", "email": "person@example.com"})
client.track({"event": "checkout.completed", "external_id": "user_123"})

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages