OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone, forever free.
feat(alerts): make price alerts an OpenStock Cloud feature
ravixalgorithme844ac413c74
diff --git a/README.md b/README.mdindex 17f790d..133249a 100644--- a/README.md+++ b/README.md@@ -46,7 +46,7 @@# OpenStock-OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone, forever free.+OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, watch the whole market, and explore detailed company insights — built openly, for everyone, forever free.Note: OpenStock is community-built and not a brokerage. Market data may be delayed based on provider rules and your configuration. Nothing here is financial advice.@@ -290,7 +290,8 @@ INNGEST_EVENT_KEY=your_inngest_event_key# Market data (optional)# Several free Finnhub keys, rotated per request: each adds 60 requests/min.# FINNHUB_API_KEYS=key_one,key_two-# "cached" (default) refreshes quotes hourly for everyone; "realtime" refreshes every 15s.+# "cached" (default) refreshes quotes hourly for everyone; "realtime" refreshes every 15s+# and turns on email price alerts (an OpenStock Cloud feature).# NEXT_PUBLIC_OPENSTOCK_DATA_MODE=cached# Social sign-in (optional; each provider is hidden server-side until set)@@ -347,7 +348,8 @@ INNGEST_EVENT_KEY=your_inngest_event_key# Market data (optional)# Several free Finnhub keys, rotated per request: each adds 60 requests/min.# FINNHUB_API_KEYS=key_one,key_two-# "cached" (default) refreshes quotes hourly for everyone; "realtime" refreshes every 15s.+# "cached" (default) refreshes quotes hourly for everyone; "realtime" refreshes every 15s+# and turns on email price alerts (an OpenStock Cloud feature).# NEXT_PUBLIC_OPENSTOCK_DATA_MODE=cached# Social sign-in (optional; each provider is hidden server-side until set)diff --git a/__tests__/alert-actions.test.ts b/__tests__/alert-actions.test.tsindex 5f3e4c8..619a867 100644--- a/__tests__/alert-actions.test.ts+++ b/__tests__/alert-actions.test.ts@@ -7,6 +7,9 @@ const requireUserId = vi.fn();vi.mock('@/lib/better-auth/auth', () => ({ requireUserId: () => requireUserId() }));vi.mock('next/cache', () => ({ revalidatePath: vi.fn() }));vi.mock('@/database/mongoose', () => ({ connectToDatabase: vi.fn().mockResolvedValue({}) }));+// Alerts are an OpenStock Cloud feature; most tests run with it on+const flags = { alertsEnabled: true };+vi.mock('@/lib/market-data', () => ({ get alertsEnabled() { return flags.alertsEnabled; } }));const findOneAndDelete = vi.fn();const create = vi.fn();@@ -49,6 +52,16 @@ describe('alert actions are scoped to the session user', () => {expect(create).toHaveBeenCalledWith(expect.objectContaining({ userId: 'user-123', symbol: 'AAPL' }));});+ it('refuses new alerts where Cloud features are off', async () => {+ flags.alertsEnabled = false;+ try {+ await expect(createAlert({ symbol: 'AAPL', targetPrice: 200, condition: 'ABOVE' })).rejects.toThrow('OpenStock Cloud');+ expect(create).not.toHaveBeenCalled();+ } finally {+ flags.alertsEnabled = true;+ }+ });+it('refuses alerts the checker could never price', async () => {await expect(createAlert({ symbol: 'RELIANCE.NS', targetPrice: 1000, condition: 'ABOVE' })).rejects.toThrow('US stocks and crypto');expect(create).not.toHaveBeenCalled();diff --git a/app/(marketing)/about/page.tsx b/app/(marketing)/about/page.tsxindex 38b68d9..a0ab5c1 100644--- a/app/(marketing)/about/page.tsx+++ b/app/(marketing)/about/page.tsx@@ -11,7 +11,7 @@ export const metadata = {};const PRINCIPLES = [- { icon: Globe, title: 'Open access', body: 'No premium tiers for core features. Charts, watchlists and alerts stay free for everyone.' },+ { icon: Globe, title: 'Open access', body: 'No paywall on the core. Charts, watchlists and research stay free for everyone, and self-hosting unlocks everything.' },{ icon: Code, title: 'Open source', body: 'Fully transparent codebase. Audit our algorithms, contribute features, and build with us.' },{ icon: Heart, title: 'Community driven', body: 'Powered by donations and volunteers. We answer to our users, not shareholders.' },];diff --git a/app/(marketing)/api-docs/page.tsx b/app/(marketing)/api-docs/page.tsxindex 5c8c18a..56e06d8 100644--- a/app/(marketing)/api-docs/page.tsx+++ b/app/(marketing)/api-docs/page.tsx@@ -11,7 +11,7 @@ export const metadata = {const DATA_MODES = [{ name: 'Cached', cadence: 'Hourly', body: 'Default for the public site. Quotes are fetched once an hour and shared by every user, so cost grows with symbols, not people.' },- { name: 'Realtime', cadence: 'Every 15 seconds', body: 'For OpenStock Cloud and self-hosting. Set NEXT_PUBLIC_OPENSTOCK_DATA_MODE=realtime and on-screen prices refresh live.' },+ { name: 'Realtime', cadence: 'Every 15 seconds', body: 'For OpenStock Cloud and self-hosting. Set NEXT_PUBLIC_OPENSTOCK_DATA_MODE=realtime and on-screen prices refresh live and email price alerts turn on.' },];const COVERAGE = [@@ -26,7 +26,7 @@ const FLOW = ['A user signs up, or a cron fires', 'Inngest runs the function', 'const JOBS = [{ icon: Mail, title: 'Welcome email', trigger: 'On sign-up', body: 'An AI-written intro tailored to the country, goal, risk and industry picked at sign-up.' },{ icon: BarChart2, title: 'Weekly news', trigger: 'Mon 09:00', body: 'Summarises the week’s market news and sends it as a Kit broadcast.' },- { icon: Clock, title: 'Price alerts', trigger: 'Every 5 min', body: 'Checks every active alert against Finnhub quotes and emails the owner when one fires.' },+ { icon: Clock, title: 'Price alerts', trigger: 'Every 5 min', body: 'Checks every active alert against Finnhub quotes and emails the owner when one fires. Realtime mode only.' },{ icon: UserX, title: 'Re-engagement', trigger: 'Daily 10:00', body: 'Finds dormant accounts and sends a gentle nudge.' },];diff --git a/app/(marketing)/help/page.tsx b/app/(marketing)/help/page.tsxindex 5c18408..07878c9 100644--- a/app/(marketing)/help/page.tsx+++ b/app/(marketing)/help/page.tsx@@ -13,7 +13,7 @@ export const metadata: Metadata = {const FAQS = [{question: 'Is OpenStock really free?',- answer: 'Yes. We run on sponsors and community contributions. Core features (charts, watchlists, alerts) stay free. OpenStock Cloud, coming soon, adds live quotes for $5 a month.',+ answer: 'Yes. We run on sponsors and community contributions. Charts, watchlists and research stay free. OpenStock Cloud, coming soon, adds live quotes and email price alerts for $5 a month. Self-hosting includes both.',},{question: 'How do I add a stock to my watchlist?',@@ -29,7 +29,7 @@ const FAQS = [},{question: 'My alert hasn’t fired.',- answer: 'Alerts are checked every five minutes and emailed to your account address when the price crosses your target. Check the alert’s status on the watchlist page.',+ answer: 'Price alerts are part of OpenStock Cloud (or a self-hosted instance in realtime mode). There they are checked every five minutes and emailed to your account address when the price crosses your target. Check the alert’s status on the watchlist page.',},{question: 'Can I contribute code or designs?',diff --git a/app/(marketing)/page.tsx b/app/(marketing)/page.tsxindex 49f22db..df4296b 100644--- a/app/(marketing)/page.tsx+++ b/app/(marketing)/page.tsx@@ -11,7 +11,7 @@ import { DISCORD_URL, GOOD_FIRST_ISSUES_URL, REPO_URL } from "@/lib/constants";const FEATURES = [{ icon: CandlestickChart, title: 'Charts that move', body: 'TradingView candles, technicals and financials for any listed company, full screen when you need room.' },- { icon: Bell, title: 'Alerts by email', body: 'Set a target above or below the price. We check every five minutes and write when it crosses.' },+ { icon: Bell, title: 'Alerts by email', body: 'With OpenStock Cloud, set a target above or below the price. We check every five minutes and write when it crosses.' },{ icon: MessagesSquare, title: 'Sentiment in one read', body: 'Buzz and bullishness from Reddit, X.com, news and Polymarket, side by side for each stock.' },{ icon: Grid3x3, title: 'The whole market', body: 'Sector heatmap, movers and top stories on one screen before the bell.' },{ icon: Command, title: 'Find anything with ⌘K', body: 'Search every exchange Finnhub covers and open a stock as a tab, like a browser.' },@@ -26,12 +26,12 @@ const TIERS = [},{name: 'OpenStock Cloud', price: '$5', per: '/month', tag: 'Coming soon', cadence: 'Every 15 seconds', perHour: 240,- body: 'The same app with live quotes, hosted on a pool of market data keys. Nothing to set up.',+ body: 'The same app with live quotes and email price alerts, hosted on a pool of market data keys. Nothing to set up.',cta: { label: 'Get notified on Discord', href: DISCORD_URL },},{name: 'Self-host', price: 'Free', cadence: 'Your call', perHour: 240,- body: 'Run it on your own server with your own Finnhub keys, realtime for you and your team.',+ body: 'Run it on your own server with your own Finnhub keys: realtime quotes and alerts for you and your team.',cta: { label: 'Setup guide', href: '#self-host' },},];@@ -80,7 +80,7 @@ export default async function LandingPage() {Markets, minus<br />the paywall.</h1><p className="mt-5 max-w-xl text-[17px] leading-relaxed text-muted-foreground">- OpenStock is an open-source alternative to expensive market platforms. Track prices, set alerts and dig into+ OpenStock is an open-source alternative to expensive market platforms. Track prices, watch the whole market and dig intocompany insights, built openly, for everyone.</p><div className="mt-8 flex flex-wrap items-center gap-2">diff --git a/app/(root)/profile/page.tsx b/app/(root)/profile/page.tsxindex ffd11e8..a4c47ce 100644--- a/app/(root)/profile/page.tsx+++ b/app/(root)/profile/page.tsx@@ -7,6 +7,7 @@ import PasswordForm from "@/components/profile/PasswordForm";import { auth, getSession } from "@/lib/better-auth/auth";import { getUserWatchlist } from "@/lib/actions/watchlist.actions";import { getUserAlerts } from "@/lib/actions/alert.actions";+import { alertsEnabled } from "@/lib/market-data";export const metadata = { title: 'Profile | OpenStock' };@@ -32,7 +33,7 @@ export default async function ProfilePage() {const stats = [{ label: 'Watching', value: watchlist.length, icon: Star },- { label: 'Active alerts', value: activeAlerts, icon: Bell },+ { label: alertsEnabled ? 'Active alerts' : 'Paused alerts', value: activeAlerts, icon: Bell },{ label: 'Sign-in methods', value: linked.size, icon: ShieldCheck },];diff --git a/app/(root)/watchlist/page.tsx b/app/(root)/watchlist/page.tsxindex b6d920d..2ca3994 100644--- a/app/(root)/watchlist/page.tsx+++ b/app/(root)/watchlist/page.tsx@@ -2,6 +2,7 @@ import { Suspense } from 'react';import { Plus } from 'lucide-react';import { getUserWatchlist } from '@/lib/actions/watchlist.actions';import { getUserAlerts } from '@/lib/actions/alert.actions';+import { alertsEnabled } from '@/lib/market-data';import { getNews, getWatchlistData } from '@/lib/actions/finnhub.actions';import WatchlistTable from '@/components/watchlist/WatchlistTable';import AlertsPanel from '@/components/watchlist/AlertsPanel';@@ -62,7 +63,7 @@ export default async function WatchlistPage() {</Panel></div>- <Panel title="Alerts" sub={`${activeAlerts} active · checked every 5 minutes`} className="self-start">+ <Panel title="Alerts" sub={alertsEnabled ? `${activeAlerts} active · checked every 5 minutes` : 'An OpenStock Cloud feature'} className="self-start"><AlertsPanel alerts={alerts} /></Panel></div>diff --git a/app/api/inngest/route.ts b/app/api/inngest/route.tsindex caf822a..9734118 100644--- a/app/api/inngest/route.ts+++ b/app/api/inngest/route.ts@@ -1,8 +1,10 @@import { serve } from "inngest/next";import { inngest } from "@/lib/inngest/client";+import { alertsEnabled } from "@/lib/market-data";import { sendWeeklyNewsSummary, sendSignUpEmail, checkStockAlerts, checkInactiveUsers } from "@/lib/inngest/functions";export const { GET, POST, PUT } = serve({client: inngest,- functions: [sendSignUpEmail, sendWeeklyNewsSummary, checkStockAlerts, checkInactiveUsers],+ // Price alerts are an OpenStock Cloud feature, so the checker only runs where they are on+ functions: [sendSignUpEmail, sendWeeklyNewsSummary, checkInactiveUsers, ...(alertsEnabled ? [checkStockAlerts] : [])],})\ No newline at end of filediff --git a/components/watchlist/AlertsPanel.tsx b/components/watchlist/AlertsPanel.tsxindex 58139e4..3138076 100644--- a/components/watchlist/AlertsPanel.tsx+++ b/components/watchlist/AlertsPanel.tsx@@ -1,10 +1,12 @@"use client";import React, { useState } from "react";+import Link from "next/link";import { useRouter } from "next/navigation";import { BellRing, Trash2 } from "lucide-react";import { toast } from "sonner";import { deleteAlert } from "@/lib/actions/alert.actions";+import { alertsEnabled } from "@/lib/market-data";import { formatPrice } from "@/lib/utils";type AlertRow = {@@ -19,6 +21,7 @@ type AlertRow = {const statusOf = (alert: AlertRow) => {if (alert.triggered) return { label: 'Triggered', className: 'pill is-brand' };+ if (!alertsEnabled) return { label: 'Paused', className: 'pill' };if (alert.expiresAt && new Date(alert.expiresAt) < new Date()) return { label: 'Expired', className: 'pill' };if (alert.active === false) return { label: 'Paused', className: 'pill' };return { label: 'Watching', className: 'pill is-up' };@@ -41,6 +44,17 @@ export default function AlertsPanel({ alerts }: { alerts: AlertRow[] }) {}};+ if (alerts.length === 0 && !alertsEnabled) {+ return (+ <div className="empty-state py-10">+ <span className="empty-icon"><BellRing className="size-5" /></span>+ <h3>Alerts come with Cloud</h3>+ <p className="max-w-64 text-[13px]">Email price alerts are part of OpenStock Cloud, $5 a month and coming soon.</p>+ <Link href="/#data" className="btn btn-ghost mt-2">See OpenStock Cloud</Link>+ </div>+ );+ }+if (alerts.length === 0) {return (<div className="empty-state py-10">@@ -52,32 +66,39 @@ export default function AlertsPanel({ alerts }: { alerts: AlertRow[] }) {}return (- <ul className="row-list">- {alerts.map((alert) => {- const status = statusOf(alert);- return (- <li key={alert._id} className="flex items-center gap-3 px-3 py-2.5">- <div className="min-w-0 flex-1">- <p className="mono font-semibold text-foreground">{alert.symbol}</p>- <p className="num truncate text-[12.5px] text-faint">- {alert.condition === 'ABOVE' ? 'Above' : 'Below'} {formatPrice(alert.targetPrice)}- {alert.expiresAt && !alert.triggered && ` · until ${new Date(alert.expiresAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric' })}`}- </p>- </div>- <span className={status.className}>{status.label}</span>- <button- type="button"- onClick={() => handleDelete(alert)}- disabled={pendingId === alert._id}- className="icon-btn is-danger"- title="Remove alert"- aria-label={`Remove alert for ${alert.symbol}`}- >- <Trash2 />- </button>- </li>- );- })}- </ul>+ <>+ {!alertsEnabled && (+ <p className="px-3 pt-3 pb-1 text-[12.5px] text-faint">+ Alerts moved to <Link href="/#data" className="text-brand-ink hover:underline">OpenStock Cloud</Link>, so these are paused.+ </p>+ )}+ <ul className="row-list">+ {alerts.map((alert) => {+ const status = statusOf(alert);+ return (+ <li key={alert._id} className="flex items-center gap-3 px-3 py-2.5">+ <div className="min-w-0 flex-1">+ <p className="mono font-semibold text-foreground">{alert.symbol}</p>+ <p className="num truncate text-[12.5px] text-faint">+ {alert.condition === 'ABOVE' ? 'Above' : 'Below'} {formatPrice(alert.targetPrice)}+ {alert.expiresAt && !alert.triggered && ` · until ${new Date(alert.expiresAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric' })}`}+ </p>+ </div>+ <span className={status.className}>{status.label}</span>+ <button+ type="button"+ onClick={() => handleDelete(alert)}+ disabled={pendingId === alert._id}+ className="icon-btn is-danger"+ title="Remove alert"+ aria-label={`Remove alert for ${alert.symbol}`}+ >+ <Trash2 />+ </button>+ </li>+ );+ })}+ </ul>+ </>);}diff --git a/components/watchlist/CreateAlertModal.tsx b/components/watchlist/CreateAlertModal.tsxindex 4d0ba70..32c98e9 100644--- a/components/watchlist/CreateAlertModal.tsx+++ b/components/watchlist/CreateAlertModal.tsx@@ -1,8 +1,10 @@"use client";import React, { useState } from "react";+import Link from "next/link";import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "@/components/ui/dialog";import { createAlert } from "@/lib/actions/alert.actions";+import { alertsEnabled } from "@/lib/market-data";import { formatPrice } from "@/lib/utils";import { cn } from "@/lib/utils";import { toast } from "sonner";@@ -56,62 +58,79 @@ export default function CreateAlertModal({ symbol, currentPrice, currency = 'USD<Dialog open={open} onOpenChange={onOpenChange}>{children && <DialogTrigger asChild>{children}</DialogTrigger>}<DialogContent className="sm:max-w-[420px] gap-5">- <div>- <p className="kicker text-brand-ink">Price alert</p>- <DialogTitle className="mt-1 text-xl font-bold tracking-tight mono">{symbol}</DialogTitle>- <DialogDescription className="mt-1 text-[13px] text-faint">- We email you when the price crosses your target. Checked every 5 minutes, expires after 90 days.- </DialogDescription>- </div>+ {alertsEnabled ? (+ <>+ <div>+ <p className="kicker text-brand-ink">Price alert</p>+ <DialogTitle className="mt-1 text-xl font-bold tracking-tight mono">{symbol}</DialogTitle>+ <DialogDescription className="mt-1 text-[13px] text-faint">+ We email you when the price crosses your target. Checked every 5 minutes, expires after 90 days.+ </DialogDescription>+ </div>- <form onSubmit={handleSubmit} className="flex flex-col gap-4">- <div className="grid grid-cols-2 gap-1 rounded-[12px] bg-page p-1" role="radiogroup" aria-label="Condition">- {CONDITIONS.map(({ value, label }) => (- <button- key={value}- type="button"- role="radio"- aria-checked={condition === value}- onClick={() => setCondition(value)}- className={cn(- 'h-9 rounded-[9px] font-semibold transition-colors',- condition === value ? 'bg-hover text-foreground shadow-[inset_0_1px_0_oklch(1_0_0/0.06)]' : 'text-faint hover:text-foreground',- )}- >- {label}- </button>- ))}- </div>+ <form onSubmit={handleSubmit} className="flex flex-col gap-4">+ <div className="grid grid-cols-2 gap-1 rounded-[12px] bg-page p-1" role="radiogroup" aria-label="Condition">+ {CONDITIONS.map(({ value, label }) => (+ <button+ key={value}+ type="button"+ role="radio"+ aria-checked={condition === value}+ onClick={() => setCondition(value)}+ className={cn(+ 'h-9 rounded-[9px] font-semibold transition-colors',+ condition === value ? 'bg-hover text-foreground shadow-[inset_0_1px_0_oklch(1_0_0/0.06)]' : 'text-faint hover:text-foreground',+ )}+ >+ {label}+ </button>+ ))}+ </div>- <label className="flex flex-col gap-2">- <span className="form-label">Target price</span>- <span className="flex h-12 items-center gap-2 rounded-[11px] border border-line bg-page px-3 focus-within:border-brand">- <span className="mono text-faint">{currency}</span>- <input- type="number"- inputMode="decimal"- step="0.01"- min="0.01"- required- autoFocus- value={targetPrice}- onChange={(e) => setTargetPrice(e.target.value)}- className="num w-full bg-transparent text-lg font-semibold text-foreground outline-none"- />- </span>- <span className={cn('num text-[12.5px]', alreadyMet ? 'text-warn' : 'text-faint')}>- {!hasPrice- ? 'Current price unavailable'- : alreadyMet- ? `Already ${condition === 'ABOVE' ? 'above' : 'below'} this — it will fire on the next check`- : `Now ${formatPrice(currentPrice!, currency)}${distance === null ? '' : ` · ${distance > 0 ? '+' : ''}${distance.toFixed(2)}% away`}`}- </span>- </label>+ <label className="flex flex-col gap-2">+ <span className="form-label">Target price</span>+ <span className="flex h-12 items-center gap-2 rounded-[11px] border border-line bg-page px-3 focus-within:border-brand">+ <span className="mono text-faint">{currency}</span>+ <input+ type="number"+ inputMode="decimal"+ step="0.01"+ min="0.01"+ required+ autoFocus+ value={targetPrice}+ onChange={(e) => setTargetPrice(e.target.value)}+ className="num w-full bg-transparent text-lg font-semibold text-foreground outline-none"+ />+ </span>+ <span className={cn('num text-[12.5px]', alreadyMet ? 'text-warn' : 'text-faint')}>+ {!hasPrice+ ? 'Current price unavailable'+ : alreadyMet+ ? `Already ${condition === 'ABOVE' ? 'above' : 'below'} this — it will fire on the next check`+ : `Now ${formatPrice(currentPrice!, currency)}${distance === null ? '' : ` · ${distance > 0 ? '+' : ''}${distance.toFixed(2)}% away`}`}+ </span>+ </label>- <button type="submit" disabled={loading || !(target > 0)} className="btn btn-primary h-11">- {loading ? 'Setting alert' : 'Set alert'}- </button>- </form>+ <button type="submit" disabled={loading || !(target > 0)} className="btn btn-primary h-11">+ {loading ? 'Setting alert' : 'Set alert'}+ </button>+ </form>+ </>+ ) : (+ // Alerts are an OpenStock Cloud feature; the free hourly site points people to it+ <div>+ <p className="kicker text-brand-ink">OpenStock Cloud</p>+ <DialogTitle className="mt-1 text-xl font-bold tracking-tight">Price alerts come with Cloud</DialogTitle>+ <DialogDescription className="mt-2 text-[13.5px] leading-relaxed text-muted-foreground">+ Cloud adds email price alerts and live quotes for $5 a month. It’s coming soon. Self-hosting includes both today.+ </DialogDescription>+ <div className="mt-5 flex gap-2">+ <Link href="/#data" className="btn btn-primary h-11 flex-1">See OpenStock Cloud</Link>+ <Link href="/#self-host" className="btn btn-ghost h-11">Self-host</Link>+ </div>+ </div>+ )}</DialogContent></Dialog>);diff --git a/lib/actions/alert.actions.ts b/lib/actions/alert.actions.tsindex cb02b80..bd586ca 100644--- a/lib/actions/alert.actions.ts+++ b/lib/actions/alert.actions.ts@@ -5,6 +5,7 @@ import { Alert } from '@/database/models/alert.model';import { revalidatePath } from 'next/cache';import { requireUserId } from '@/lib/better-auth/auth';import { hasFinnhubQuotes } from '@/lib/markets';+import { alertsEnabled } from '@/lib/market-data';// A ticker (AAPL, BRK.B) or a Binance pair. Anything else, including markup, is rejected:// the symbol ends up in alert emails.@@ -18,6 +19,7 @@ export async function createAlert(params: {condition: 'ABOVE' | 'BELOW';}) {const userId = await requireUserId();+ if (!alertsEnabled) throw new Error('Price alerts are part of OpenStock Cloud');const symbol = String(params.symbol ?? '').trim().toUpperCase();const targetPrice = Number(params.targetPrice);const condition = params.condition;diff --git a/lib/market-data.ts b/lib/market-data.tsindex dcbd92a..8ecbdd2 100644--- a/lib/market-data.ts+++ b/lib/market-data.ts@@ -9,3 +9,6 @@ export const DATA_MODE: DataMode = process.env.NEXT_PUBLIC_OPENSTOCK_DATA_MODE =export const QUOTE_TTL_SECONDS = DATA_MODE === 'realtime' ? 15 : 3600;export const isRealtime = DATA_MODE === 'realtime';++// Email price alerts are an OpenStock Cloud feature: on in realtime mode (Cloud or self-hosted), off on the free hourly site.+export const alertsEnabled = isRealtime;diff --git a/lib/nodemailer/templates.ts b/lib/nodemailer/templates.tsindex 063ba49..fd3a434 100644--- a/lib/nodemailer/templates.ts+++ b/lib/nodemailer/templates.ts@@ -128,7 +128,7 @@ export const WELCOME_EMAIL_TEMPLATE = `<!DOCTYPE html><!-- Feature List --><ul class="mobile-text dark-text-secondary" style="margin: 0 0 30px 0; padding-left: 20px; font-size: 16px; line-height: 1.6; color: #CCDADC;"><li style="margin-bottom: 12px;">Set up your watchlist to follow your favorite stocks</li>- <li style="margin-bottom: 12px;">Create price and volume alerts so you never miss a move</li>+ <li style="margin-bottom: 12px;">Search any stock with ⌘K and open it as a tab</li><li style="margin-bottom: 12px;">Explore the dashboard for trends and the latest market news</li></ul>