A client-server notification system for HTML emails, sms and more.
Project description
🚩 Table of contents
👀 What is tattler?
Are you building an online service and need to send beautiful, branded notifications via email or SMS to your users?
Tattler makes that easy for you. Your application makes a simple HTTP call to tattler:
curl -X POST 'http://127.0.0.1:11503/notification/mywebapp/password_changed/?user=123'
Tattler helps you with these basics:
Templates: Load and expand powerful templates for event password_changed for email, SMS etc.
MIME: Assemble a multi-part email with HTML, text fallback and advanced headers that satisfy spam filters.
Delivery: Send the content through SMTP and an SMS delivery network.
Live previews: Get faithful email previews in real-time as you edit your templates.
and here’s some more advanced features:
Dev mode: Let your applications trigger notifications to the real user, while tattler only delivers to your debug address.
Addressbook: Fetch the user’s email address and mobile number from your DB (with trivial-to-write plug-ins).
Template data: Fetch variables for your templates from your DB (with trivial-to-write plug-ins).
Tattler is designed with simplicity in mind. It strives for trivial deployment so you can focus on your communication, brand and customer journey.
If your system sends notifications from multiple different softwares – say a web application, a billing daemon, and a cron job which monitors inventory – then tattler multiples your simplification gains 🚀
😵💫 Don’t beat around the bush!
Tattler is:
a server
written in python
for UNIX systems
that exposes a REST interface
which your applications contact
to request delivery of notifications to users.
🤩 Examples
Here’s a little gallery of notifications sent via tattler to email and SMS:
🚀 Quick start
Install tattler:
# create and load a virtualenv to install into
mkdir ~/tattler_quickstart
python3 -m venv ~/tattler_quickstart/venv
. ~/tattler_quickstart/venv/bin/activate
# install tattler into it
pip install tattler
Run tattler server:
export TATTLER_MASTER_MODE=production
# if you need to customize your SMTP settings
export TATTLER_SMTP_ADDRESS="127.0.0.1:25"
export TATTLER_SMTP_AUTH="username:password" # you will learn secure configuration later
export TATTLER_SMTP_TLS=yes
# run tattler server on default 127.0.0.1:11503
tattler_server
Trigger a demo notification via HTTP:
# in a new terminal:
# replace ``your@email.com`` with your actual email address
curl -X POST 'http://127.0.0.1:11503/notification/demoscope/demoevent/?mode=production&user=your@email.com'
… or via command-line utility:
# load the same virtual environment where you installed tattler server
. ~/tattler_quickstart/venv/bin/activate
# replace ``your@email.com`` with your actual email address
tattler_notify -s '127.0.0.1:11503' -m production your@email.com demoscope demoevent
… or via tattler’s python SDK:
from tattler.client.tattler_py import send_notification
# replace ``your@email.com`` with your actual email address
send_notification('demoscope', 'demoevent', 'your@email.com', mode='production', srv_addr='127.0.0.1', srv_port=11503)
Done!
Want more? Proceed to the complete quickstart in tattler’s documentation for plug-ins, deployment and more.
📋 Templates
Tattler uses the powerful Jinja as default template engine:
Dear {{ user_firstname }}!
Thank you for your order #{{ order.number }} with {{ order.products|length }} products:
{% for product in order.products %}
- {{ product.name }}
{% endfor %}
{% if user_account_type == 'premium' %}
As a premium customer, your order will be at your doorstep tomorrow!
{% else %}
Delivery is expected by {{ delivery_date }}.
{% endif %}
{# a comment #}
Used to a different template engine already? Tattler also supports customizing this, too.
Tattler also allows you to share common style among all your notifications with base templates. Put your style, header, footer and any common text into the base template – so your event templates only need to define the content specific to them.
📸 Live previews
Perfect your communication in no time by getting high-fidelity, real-time previews while you edit your templates.
Tattler includes tattler_livepreview, which monitors your template files, and fires a preview notification as soon as they change.
What’s cool about this:
You get the real output directly in your email program, where your users will. No misleading shortcuts with browsers!
You get variables expanded too, giving you faithful previews of your filters, loops, conditionals etc.
You do continual testing of template expansion before go-live, because tattler_livepreview runs through the very logic used by tattler_server.
💙 Help us be better
Here’s how you can help:
⭐️ star our repository if you like tattler. That’s our go-to place whenever we feel sad! 😁
Post about tattler online.
And if you’re a developer:
Report any issue in our code or docs. We take those seriously.
Package tattler for your distribution. Else Ubuntu, Debian, CentOS and FreeBSD will serve the most people.
Implement a client for tattler in another language.
See our contributing guidelines for details.
🎖️ License
Tattler is open-source software (BSD 3-clause license).
📈 Enterprise users
Tattler is enterprise-friendly. Enterprise users avail of a subscription which provides a bugfixing warranty, extra features, and patronage for the continuity of the project.
📌 Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tattler-2.0.1.tar.gz
.
File metadata
- Download URL: tattler-2.0.1.tar.gz
- Upload date:
- Size: 82.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d05ae56dda22ba1f15ed2db76e765b6b67b057775028db4147c52846077f4b9e |
|
MD5 | 33d328682be871e3aaaec9a35e4f9533 |
|
BLAKE2b-256 | be095a61744ce4a30a64632f6bf4e8735bb5c051d2230c235e7a3b63ce20d091 |
File details
Details for the file tattler-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: tattler-2.0.1-py3-none-any.whl
- Upload date:
- Size: 103.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cbd19d38914e56b4827177dc728588714fd7b38c75079df3d1d6807a5c9e687 |
|
MD5 | cb395cfbb4d4b4607cd0c513be210bfd |
|
BLAKE2b-256 | 9e30614a6f1a12fd1de77350a74a73f8c5a7b4f142102644a19353e2f7c02890 |