mirror of
https://github.com/screentinker/screentinker.git
synced 2026-06-17 03:32:32 -06:00
Daily sweep (15:00 UTC) emails a warm, personal "checking in" message to users who signed up 3-14 days ago and still have no paired screen, nudging them toward activation. Once per user, reuses the Graph transport (services/email.js) via the existing fromName/rawSubject options. - New service services/activationNudge.js, started from server.js. Self-correcting daily scheduler (recompute next 15:00 UTC each run; no node-cron dependency). - Eligibility (Option B, workspace-aware): created 3-14 days ago, activation_nudge_sent_at IS NULL, COALESCE(email_alerts,1)=1 (only an explicit opt-out of 0 is excluded; NULL/unset still qualify), and ZERO devices owned by the user OR present in any workspace they belong to. The workspace check avoids nudging engaged team members. - Idempotency: activation_nudge_sent_at, stamped after send; paired sentinel-1 backfill so the first sweep can't blast the dormant legacy base. Only genuinely-new signups become eligible. - GATE: HOSTED_INSTANCE=true (positive hosted signal, NOT !selfHosted). A daily bulk sweep would be far worse to leak than a single email, so a self-hoster who configured Graph but missed SELF_HOSTED won't blast their user base. Unset -> neither scheduled nor sent. Documented in .env.example.
37 lines
1.8 KiB
Plaintext
37 lines
1.8 KiB
Plaintext
# ScreenTinker server configuration — process environment variables.
|
|
#
|
|
# NOTE: the app reads these from the *process environment* (your systemd unit's
|
|
# Environment=/EnvironmentFile=, your container runtime, or your shell). It does
|
|
# NOT auto-load this file. Copy the values you need into your process manager.
|
|
# This file exists only to document the available options.
|
|
|
|
# --- Self-hosting ---
|
|
# Set to "true" on your own instance. When true, the hosted signup emails
|
|
# (welcome to the user + admin notification) are disabled, so a self-hosted
|
|
# instance never emits mail from a domain that isn't yours.
|
|
SELF_HOSTED=true
|
|
|
|
# Where new-signup admin notifications are sent. Leave UNSET to disable admin
|
|
# notifications entirely — the user's welcome email is unaffected. Self-hosters
|
|
# who want to be notified of signups set this to their own address.
|
|
# ADMIN_NOTIFY_EMAIL=you@example.com
|
|
|
|
# Marks THIS deployment as the hosted (screentinker.com) instance. Gates the
|
|
# daily activation-nudge sweep (the T+3 "haven't paired a screen yet?" email).
|
|
# Leave UNSET on self-hosted instances so a daily bulk sweep never emails your
|
|
# user base with our onboarding mail. Only the hosted instance sets this true.
|
|
# HOSTED_INSTANCE=true
|
|
|
|
# --- Outbound email (Microsoft Graph, client-credentials flow) ---
|
|
# Required for ANY email (welcome, offline alerts, admin notify) to actually
|
|
# send. Leave blank and the app logs "[EMAIL] not configured" instead of sending.
|
|
# GRAPH_TENANT_ID=
|
|
# GRAPH_CLIENT_ID=
|
|
# GRAPH_CLIENT_SECRET=
|
|
# GRAPH_SENDER_EMAIL=signage@example.com
|
|
# GRAPH_SENDER_NAME=ScreenTinker
|
|
# Dev safety net: comma-separated allow-list of recipients. When set, mail to
|
|
# any address NOT in the list is suppressed (logged, not sent). Leave UNSET in
|
|
# production. Useful locally so test signups can't email real users.
|
|
# GRAPH_DEV_RESTRICT_TO=me@example.com
|