No description
Find a file
2025-10-11 10:09:18 +02:00
config.json init 2025-10-11 10:09:18 +02:00
LICENSE init 2025-10-11 10:09:18 +02:00
news.json init 2025-10-11 10:09:18 +02:00
README.md init 2025-10-11 10:09:18 +02:00
run.py init 2025-10-11 10:09:18 +02:00

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:

  1. Register short URLs via the Go redirect service.
  2. Build a tracked HTML newsletter.
  3. Create and send a campaign in Listmonk.