No description
| config.json | ||
| LICENSE | ||
| news.json | ||
| README.md | ||
| run.py | ||
Newsletter Sender
A lightweight Python utility to send manually curated newsletter items to Listmonk using a configurable redirect tracking service (e.g., /go/<uuid> links).
Features
- Reads configuration and credentials from
config.json - Accepts a JSON file (
news.json) with manually curated articles - Automatically registers short redirect URLs via a Go-style tracking service
- Builds tracked HTML with
{{ .Subscriber.UUID }}for personalized tracking - Sends campaigns directly to Listmonk via its REST API
Configuration
Create a config.json file:
{
"go_api_url": "https://example.com/api/create",
"go_base_url": "https://example.com/go",
"go_admin_secret": "EXAMPLE_SECRET",
"listmonk_url": "https://listmonk.example.com/api/campaigns",
"listmonk_user": "EXAMPLE_USER",
"listmonk_password": "EXAMPLE_PASSWORD",
"list_id": 1,
"template_id": 1,
"from_email": "Example Sender <noreply@example.com>",
"subject": "What's New – Weekly Highlights"
}
News File Example
Create a news.json with your content items:
[
{
"title": "Regulators Ease SAR Burden: New FAQs Clarify Structuring Rules",
"summary": "FinCEN and U.S. banking agencies issued joint FAQs clarifying when structuring triggers a SAR.",
"url": "https://www.fincen.gov/news/news-releases/example-article"
},
{
"title": "OCC Bulletin 2025-26: Model Risk Flexibility for Community Banks",
"summary": "The OCC clarifies that community banks may tailor model risk management cadence to their risk profile.",
"url": "https://www.occ.treas.gov/news-issuances/example-bulletin.html"
}
]
Run It
python3 newsletter_sender.py news.json
The script will:
- Register short URLs via the Go redirect service.
- Build a tracked HTML newsletter.
- Create and send a campaign in Listmonk.