Add email digest schedule controls to Alert Settings #5
Loading…
Reference in a new issue
No description provided.
Delete branch "flotilla-fc1-email-digests-let-users-choose-delivery--f63"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
flotilla-fc1
Adds digest schedule controls to the Email Digest card in Alert Settings, letting users choose a daily or weekly delivery time with wall-clock timezone support. The schedule is sent to mailship via NIP-98 authenticated PUT /subscription/email and persisted cross-device through the existing AppData publishSettings path.
Changes
SettingsValuesinsrc/app/settings.tswithemailHour,emailMinute,emailDayOfWeek, andemailTimezone, defaulting to 17:00 daily in the device timezone. Persisted and synced throughpublishSettings/publishEmailSettings.src/app/mail.ts— aMailadapter class (Mail.register/Mail.unregister) that sends PUT/DELETE to mailship with the full subscription payload (email, frequency, hour, minute, dayOfWeek, timezone). Uses the same NIP-98 auth header pattern ashosting.ts.src/routes/settings/alerts/+page.sveltewith: enable toggle, email address input, daily/weekly frequency segmented toggle, HH:MM time picker, and a day-of-week selector (shown only for weekly). Mailship validation errors surface via the existing toast path.VITE_MAILSHIP_URLenv var for the mailship backend endpoint.How to test
@fragua resolve_conflicts guidance (PR retargeted: dev → email-notifications):
This branch was built against dev and duplicates the email-notifications feature. Resolution intent when integrating:
src/app/mail/index.ts(Mail adapter),VITE_EMAIL_NOTIFICATION_SERVERinsrc/app/env.ts, the existing email card +email/emailAddress/emailFrequencysettings fields on this branch.SettingsValuesinsrc/app/settings.tswithemailHour/emailMinute/emailDayOfWeek/emailTimezone(persisted via the existing AppData settings sync), add the HH:MM time input (both frequencies) + day-of-week picker (weekly only) to the existing email card insrc/routes/settings/alerts/+page.svelte, and extend the Mail adapter PUT payload withhour/minute/dayOfWeek/timezone.src/app/mail.ts(single file), the.envVITE_MAILSHIP_URLaddition and any second email card / second adapter.PUT /subscription/email contract (mailship, merged PR #28):
{email, frequency, hour, minute, dayOfWeek, timezone}.Verify
pnpm checkpasses before pushing.5c4e07bb8dtof9878fdff1Conflicts resolved — branch rebuilt on top of email-notifications (was dev-based) and force-pushed.
Resolution: kept the email-notifications implementation (
src/app/mail/index.tsadapter,VITE_EMAIL_NOTIFICATION_SERVER, the existing gated email card with NIP-98 register/enable flow + communities warning) and layered the schedule feature onto it:emailHour/emailMinute/emailDayOfWeek/emailTimezoneinSettingsValues(defaults 17:00, device TZ), HH:MM time input + weekly day-of-week picker in the card, weekly select defaults day to Monday, PUT payload extended to{email, frequency, hour, minute, dayOfWeek, timezone}(mailship PR #28 contract). Dropped the dev-based dups:src/app/mail.ts,VITE_MAILSHIP_URL. Verified: svelte-check 0 errors, eslint clean, prettier clean.