Changeset 8d32dcf in Klonkt for src/services/SubscriberService.js


Ignore:
Timestamp:
06/19/2026 06:47:40 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
84325b8
Parents:
b9dc94c
Message:

Show agenda + notify-me (premium feature #8) — last of the 8

  • DB: shows (site_id, date, time, city, venue, country, ticket_url, notes).
  • routes/shows.js (public, premium-gated): GET /shows (upcoming shows + notify form), POST /shows/notify (subscribers source 'notify', double opt-in if SMTP; confirm/unsub via the generic /nieuwsbrief links).
  • routes/admin-shows.js (site admin + premium): GET /admin/shows (list + add form + subscriber count), POST / (add; optional notify email to 'notify' subscribers if SMTP is available), POST /:id/delete.
  • SubscriberService.confirmedFor(siteId, source?) — optional source filter ('notify').
  • views: pages/shows.ejs + pages/admin-shows.ejs. Dashboard 📅 Agenda link.

Notify email requires SMTP (like #1/#2 sending); without SMTP the show is saved
and sign-ups still work. node --check passed.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/SubscriberService.js

    rb9dc94c r8d32dcf  
    6969}
    7070
    71 /** Bevestigde abonnees (email + token) voor een site — voor het versturen. */
    72 export function confirmedFor(siteId) {
     71/** Bevestigde abonnees (email + token) voor een site — voor het versturen.
     72 * Optioneel filteren op bron (bv. 'notify' voor show-aankondigingen). */
     73export function confirmedFor(siteId, source) {
     74  if (source) {
     75    return db.prepare("SELECT email, token FROM subscribers WHERE site_id = ? AND status = 'confirmed' AND source = ?").all(siteId, source);
     76  }
    7377  return db.prepare("SELECT email, token FROM subscribers WHERE site_id = ? AND status = 'confirmed'").all(siteId);
    7478}
Note: See TracChangeset for help on using the changeset viewer.