The first-party notifications plugin (plugins/notifications, providerType: notifications, plugin API 1.3) sends player campaigns: win-back offers for players who stopped playing, a welcome series, daily free-chip reminders, a refill offer when a player runs out of play chips, tournament reminders and one-off promotions. Campaigns reach players in-app (the notification list), by push and by email, and can carry a reward (virtual chips, real money, tournament tickets, or a virtual or real bonus with wagering) that the player claims. Nothing is credited when a message is sent.
It’s sold separately as notifications-<version>.tgz; Poker Engine releases don’t include it. Install it with Upload plugin on Extensions › Plugins, which shows the consent dialog (see Installing the First-Party Plugins).
For operators
Before you start
- Email uses the SMTP settings in Settings › Server & Email Delivery and goes through the email outbox like every other email (see System Emails). Promotional email is a marketing send: it only reaches players who opted in to marketing email (everyone starts opted out; see Marketing consent) and carries a one-click unsubscribe link. Email in the Promotions and news and Free-chip offers categories is always marketing (the engine enforces it). Tournament reminders and claim confirmations are transactional.
- Push needs push notifications configured on the server.
- Real-money rewards (
real,bonus-real) need the real-money feature on and a daily real-money cap above 0 for this plugin under Wallet daily caps in its details (Extensions › Plugins, View details) (the default is 0, which blocks them). Virtual and ticket rewards are unlimited unless you set a cap. Bonus rewards need the bonuses feature.
The campaigns page
Growth › Notification campaigns (/admin/plugins/notifications/campaigns):
- The campaign list: name, category, channels and reward, the trigger, an Enabled switch, and the stats: messages sent per channel (in-app / push / email), skipped deliveries and channels by reason (in words, e.g. "No marketing consent: 3"), claims, and the amount paid out (e.g. "2,500 chips"). A campaign that is sending shows how many players were processed so far.
- New campaign / Edit: the form below, with a live preview of the in-app and push texts, filled in with your own username and sample values.
- Send test to me: sends the campaign to your own account now, on its channels, outside every rule (audience, your own notification choices, cooldown, quiet hours, caps). A test carries no reward: its claim link opens a "test message" dialog.
- Send now (manual campaigns): sends to the campaign’s audience in pages, in the background. You are asked to confirm.
- Run trigger now (win-back, welcome and daily campaigns): evaluates the trigger at once instead of waiting for its schedule. Players who already got today’s message are not sent another.
- Delete: removes the campaign and its stats. A deleted default campaign is not seeded again.
- Recent deliveries: the last 500 deliveries with the player, the status (Sent, Skipped, Deferred, Test) and each channel’s result (for example "Email: No marketing consent · In-app: Sent").
Campaign fields
| Field | Meaning |
|---|---|
| Name, category | Promotions and news (promotions), Free-chip offers (free-chips) or Reminders (reminders): what players switch on and off per channel in Settings → Notifications. Promotions and free-chip offers are marketing categories. Campaigns saved with the old news category are sent as Promotions and news |
| Enabled | Disabled campaigns never send (a paged send stops when its campaign is disabled) |
| Trigger | See Triggers |
| Audience | Seen within N days, Registered within N days, Deposited (any / yes / no), Skip if contacted within N days (by any campaign). Manual campaigns can instead name only these players (up to 100 usernames) |
| Channels | In-app, push, email |
| Content | Subject (in-app and email subject), Message (plain text, up to 1,000 characters), optional Push title / Push text (default: subject and message), Email template: picked from a list of the plugin’s templates and your own admin templates (Site & Content › Email Templates; system emails and other plugins’ templates are not offered) |
| Reward | Type and amount, Claim link valid (hours, default 72), and for bonuses the wagering multiplier and deadline |
| Cooldown | Days before the same player can get this campaign again (0 = no cooldown) |
| Quiet hours | From / until (HH:MM) and a timezone (default: the plugin’s default timezone). A delivery that falls in the window is deferred to its end, not dropped |
Placeholders in the subject, message and push texts: {{username}}, {{amount}} (the reward, e.g. 1,000 chips), {{claimUrl}} (the claim link, /notifications?claim=<token>), {{campaignName}}, {{senderName}}; tournament reminders add {{tournamentName}}, {{startTime}} and {{minutesBefore}}. In an email, {{claimUrl}} is left out of the message text: the email template’s button links to the claim page.
Triggers
| Trigger | Who gets it, and when |
|---|---|
Inactive (days) | Players last seen between days and days + 1 days ago. Evaluated once a day (shortly after 00:00 UTC, or when the campaign is enabled); each day continues where the previous day’s window ended, so every player falls into exactly one day |
Registered (afterHours) | A welcome step: players who registered afterHours hours ago. A sweep runs every 10 minutes from a stored watermark, so registrations made while the server was down are still found. Each player gets each step once |
Daily (cron, timezone) | At the cron time (e.g. 0 18 * * * = 18:00) to players seen in the last 7 days (or the audience’s Seen within). A cron time missed by more than 6 hours (server down) is skipped, and times before the campaign was enabled are never caught up |
Low balance (virtualBelow) | When a player’s play-chip balance drops below the threshold (a debit, or a cash-table buy-in that leaves the wallet low). At most once per cooldown. While enabled with a play-chip reward, it is also the out-of-chips refill a theme can offer on demand (1.1.0, below) |
Tournament reminder (minutesBefore) | When a player registers for a scheduled tournament, a reminder is queued for minutesBefore minutes before its start; it is cancelled if they unregister. While enabled, players can also switch a reminder on for a tournament they have not registered for (1.1.0, below). Sit & go tournaments have no start time and get no reminder |
| Manual | Only when you press Send now |
"Last seen" is the player’s last connection to the site (lastSeenAt), not their last login.
Rules every delivery follows
- Bots and blocked players are never contacted.
- The audience filters apply.
- The campaign’s cooldown (
cooldown) and the audience’s "skip if contacted within" (recently_contacted). - Quiet hours: deferred to the end of the window (
deferred). - Each player gets each occurrence of a campaign at most once (a re-run of a send, a restart in the middle of one, or a second "run now" never sends twice).
- The global caps across all campaigns: Max campaign messages per player per day and per week (
frequency_cap). - Each channel is sent with the campaign’s category, so the player’s choice in Settings → Notifications applies: a channel they switched off for that category is skipped as
opted_out, the other channels still go. When no channel reached the player, the reward’s claim and the frequency-cap slot are given back. - The engine’s own per-plugin limits per player per day (20 in-app, 5 push, 2 email): a channel over the limit is skipped as
rate_limited, the other channels still go.
Channel results you may see in the stats and the log (the page shows them in words): sent, not_opted_in (No marketing consent), opted_out (Switched off by the player: the category’s channel in Settings → Notifications, or push or email switched off altogether), email_unverified, push_disabled, no_devices, circuit_open, rate_limited, failed, not_found (the email template no longer exists).
Default campaigns
Seeded once when the plugin first loads, all disabled. Edit them before you enable them.
| Campaign | Category | Trigger | Channels | Reward |
|---|---|---|---|---|
| Win-back 7 days | Free-chip offers | Inactive 7 days, cooldown 7 | In-app, push, email | 1,000 play chips |
| Win-back 30 days | Free-chip offers | Inactive 30 days, cooldown 30 | In-app, push, email | 5,000 play chips |
| Welcome day 0 | Promotions and news | Registered, 0 hours | In-app, email | none |
| Welcome day 1 | Promotions and news | Registered, 24 hours | In-app, push, email | none |
| Welcome day 3 | Promotions and news | Registered, 72 hours | In-app, push, email | none |
| Daily free-chips reminder | Reminders | Daily 0 18 * * * UTC, players seen in 7 days | In-app, push | none |
| Out-of-chips refill | Free-chip offers | Play chips below 100, cooldown 1 | In-app, push | 1,000 play chips (24 h to claim) |
| Tournament starting in 15 minutes | Reminders | Tournament reminder, 15 minutes | In-app, push, email (transactional) | none |
Email templates
The plugin registers seven templates, editable in Site & Content › Email Templates (shown with a Plugin: notifications badge, named plugin_notifications_<key>): winback, welcome, free_chips, low_balance_refill, tournament_reminder, promotion (the default) and claim_confirmation (sent after a claim, not offered for campaigns). Your edits are kept across restarts and upgrades; deleting a template brings the default back on the next load. A campaign may also use one of your own templates: the campaign form lists them under Admin templates (names of lowercase letters, digits, _ and -; system emails are never offered).
Variables the plugin fills: {{subject}}, {{body}}, {{amount}}, {{campaignName}}, {{senderName}}, {{ctaPath}} and {{ctaLabel}} (the button: the claim link /notifications?claim=<token> and "Claim your reward", or /lobby and "Play now"), {{claimPath}}, and for reminders {{tournamentName}}, {{startTime}}, {{minutesBefore}}. The engine adds {{username}} and {{siteUrl}} (the site URL from Admin → Settings → Server), so a link is written {{siteUrl}}{{ctaPath}}.
Settings
Extensions › Plugins, Settings on the Notifications row:
| Setting | Default | Meaning |
|---|---|---|
| Max campaign messages per player per day | 3 | Across all campaigns (1-50) |
| Max campaign messages per player per week | 10 | Across all campaigns, the last 7 days (1-200) |
| Default timezone | UTC | For quiet hours and daily campaigns that name none |
| Sender name | The Poker Room | Shown in the claim dialog; {{senderName}} in texts |
| Claim page title / text | Your gift is waiting / Press the button to add this reward to your account. | The claim dialog’s heading and text while the reward is waiting (after claiming it says Reward claimed) |
| Claim confirmation email | off | A transactional email after each claim |
| Browser (web) push | off | Lets players get the push channel in their browser (see below) |
| Web push VAPID public key / private key | empty | The key pair browsers’ push services check; the private key is stored encrypted |
| Web push contact | empty | A mailto: address or https: URL the push services can reach you at |
| Site address for chat links | empty | The https address of this site; Telegram and Discord messages link to it (empty leaves the link out) |
| Telegram notifications | off | Lets players link Telegram (see Telegram and Discord below) |
| Telegram bot token / bot username | empty | The bot that sends; the token is stored encrypted and never shown again |
| Discord notifications | off | Lets players link Discord |
| Discord bot token / application ID / client secret | empty | The bot that sends and the application players confirm their account with; the token and secret are stored encrypted |
Browser (web) push
Players can get campaign push messages in their browser, also on a phone where the site is installed to the home screen, without the mobile app. It is off until you switch it on:
- Generate a key pair: on the Notification campaigns page, or with
POST /api/v1/admin/notifications/web-push/vapid-keys(it returnspublicKeyandprivateKeyand stores nothing). - In the plugin’s Settings, paste both keys, enter the contact (for example
mailto:ops@example.com) and switch Browser (web) push on.
Players then see a Turn on browser notifications card on their Notifications page. Nothing is asked until they press it; the browser then asks for permission. A player can turn it off again on the same card, or block the site in the browser. Each player can have up to five browsers.
Browser push is part of the campaign’s push channel and follows the same rules: the player’s push switch and their category choice in Settings → Notifications, the caps and cooldowns, no contact with blocked players, and no promotional push during a self-exclusion or cool-off. The message holds the push title, the push text and the link only, never a balance or cards, so keep balances out of your campaign texts too. A browser the push service no longer knows is removed by itself. If you change the key pair, every player has to turn browser notifications on again.
The site itself is installable (browsers offer Install or Add to Home Screen): its name and colours come from the SEO site title and the active theme, its icon from the favicon (or logo) under Site & Content › Branding; a square PNG of at least 512 × 512 pixels works best. The installed app always loads pages and data live; only the program files and an offline page are kept on the device.
Telegram and Discord
Players can get campaign push messages in Telegram or Discord as well. Both are off until you switch them on.
- Telegram. Create a bot (for example with BotFather), enter its token and username and switch Telegram notifications on. Use a bot with no webhook, and not the bot of the Telegram Stars payments plugin: the plugin reads link confirmations by polling the bot every 5 seconds, which Telegram refuses while a webhook is set. No address of this site has to be reachable from Telegram.
- Discord. Create an application with a bot, add
<your site>/notificationsas an OAuth2 redirect, enter the bot token, the application ID and the client secret, and switch Discord notifications on. Discord only lets the bot message players who share a server with it, so invite the bot to your community server. - Enter Site address for chat links so messages can link back to the site.
Chat messages are part of the campaign’s push channel and follow its rules: the player’s push switch and category choice in Settings → Notifications, caps and cooldowns, no contact with blocked players, and no promotional message during a self-exclusion or time-out or after the player opted out. On top of that each player chooses on their Notifications page which categories may use chat; promotions and free-chip offers are off until the player switches them on. A message holds the push title, the push text and a link to this site, never a balance, cards or a wallet. Telegram messages are cut at 4,096 characters, Discord messages at 2,000.
Security notices (password or two-factor changes, a locked account) are sent by email only: a chat account is a weaker channel, and codes, reset links and anything else that grants access never go to chat.
For players
- Notifications (
/notifications): campaign messages appear in the notification list (and as a toast when the player is online). A message with a reward has a Claim button: one press credits the reward, the button turns into Claimed (or Expired once the offer ran out), and the message is marked read so the unread count drops. In the bundled themes the button is in the open message’s action bar. - Claim dialog (
/notifications?claim=<token>, the link in the message’s Open button, in push notifications and in emails): needs the player to be signed in (a signed-out player signs in first and comes back). It shows the reward and its expiry and a Claim button; after claiming it says Reward claimed, and the message is marked read when it is listed on the page. A reward can be claimed once. If it can’t be credited right now (the site’s daily rewards budget is used up, or real money is unavailable), the dialog says so and the reward stays available. An expired offer shows a friendly message; another player’s link is refused. Links sent before plugin API 1.3 (/ext/notifications/claim/<token>) redirect here. - Browser notifications: when the operator switched browser push on, the Notifications page has a Turn on browser notifications card. Pressing it opens the browser’s permission prompt; after that, push messages also appear in this browser. Turn off for this browser stops them.
- Telegram and Discord: when the operator switched one on, the Notifications page has a chat card. Link Telegram opens the site’s bot in Telegram; pressing Start there links the account (the link is single use and expires after 10 minutes). Link Discord opens Discord’s consent page and comes back to the page. Unlink stops messages at once. The card’s Send over chat switches choose the categories; promotions and free-chip offers start off. A chat account can be linked to one player at a time: linking it from a second account moves it there.
- Preferences: Settings → Notifications (
/settings#notifications) lists the plugin’s categories under Offers and reminders: Promotions and news, Free-chip offers and Reminders, each with in-app, push and email switches. Promotional email also needs the player’s marketing consent (Settings → Email). The old page/ext/notifications/preferencesredirects there.
Player tools for themes (1.1.0)
- Remind me.
GET /remindersreturns{ available, minutesBefore, tournamentIds }(availablewhile a tournament-reminder campaign is enabled);PUT /reminders/:tournamentId { on, name?, startTime? }switches a reminder on or off. It is queued like a registration’s reminder, so the same job delivers it with the same dedupe, quiet hours and caps, and registering switches it on. The start time is the engine’s when any player registered for the tournament (recorded fromtournament:registered), otherwise the client’s, accepted only in the future and within 30 days (a wrong value can only mistime the player’s own reminder). At most 50 per player. Errors: 409REMINDERS_UNAVAILABLE,TOO_MANY_REMINDERS; 400INVALID_START. - Out-of-chips refill.
GET /refillreturns{ available, amount, threshold, ready, reason, nextAt }for the first enabled low-balance campaign with a play-chip reward;POST /refillpays it when the player’s play-chip balance (read on the server) is below the campaign’s threshold, once per UTC day and per the campaign’s cooldown. It uses the same idempotency key as that day’s low-balance claim link (claim:<campaignId>:<userId>:lb-<day>), so the link and the refill pay once between them, and a per-day first-writer marker (refill:<campaignId>:<day>) makes two tabs or two nodes pay once. A refused credit (daily cap) releases the marker so the player can try again. Errors: 409REFILL_UNAVAILABLE,REFILL_NOT_NEEDED,REFILL_CLAIMED, and the claim errors.
For developers
- Categories:
registry.notify.registerCategorieson load (promotionsandfree-chipswithmarketing: true,reminders, each on in-app, push and email); every send passes the campaign’scategory, so core applies the player’s choice (opted_out) and forces marketing email. A stored campaign with a category from before API 1.3 (news) is read and sent aspromotions. - Slot fills:
notifications.item.actions(the Claim button, forsource === 'plugin:notifications'withmetadata.claimToken, or a pre-1.3 claim link) andnotifications.top(the claim dialog for?claim=<token>). The in-app message carries the token asdata: { claimToken }, and push data carries it too. Manifestredirectsforward/ext/notifications/preferencesand/ext/notifications/claim/:token. The admin page is listed withnav.section: 'marketing'. - Browser push: player routes
GET /web-push({ available, publicKey, subscriptions }),POST /web-push/subscriptions(the browser’sPushSubscriptionJSON) andPOST /web-push/unsubscribe { endpoint? }; subscriptions live in per-user storage (webpush, at most five). A campaign push goes to the browsers afterregistry.notify.pushreturned anything butopted_out(or a rate limit), encrypted per RFC 8291 and signed with VAPID (RFC 8292) usingnode:crypto; only the push services of Google, Mozilla, Apple and Microsoft are contacted. 404 and 410 answers remove the subscription. - Chat channels (
src/server/chat.ts): player routesGET /chat,POST /chat/link { service, redirectUri? }(a single-use 32-hex code, 10 minutes: the Telegram deep linkhttps://t.me/<bot>?start=<code>, or the Discord OAuth2state),POST /chat/discord/complete { code, state, redirectUri },POST /chat/unlink { service }andPUT /chat/categories. Telegram links are completed by thechat-pollscheduler job (getUpdates, private chats only, offset in global storage), so there is no inbound webhook to authenticate. Per-user storagechatholds the links (chat id and a display name) and the category choices; global storage maps a SHA-256 of the chat id to the player (chatlink:<service>:<hash>), so a chat account is linked to one player and a second proven link moves it. Calls go only toapi.telegram.organddiscord.comover https, with a 5-second time-out, at most three attempts with 250/500 ms backoff, a 429retry_afterof up to 5 seconds honoured (a longer one skips the message), and a Telegram 403 (bot blocked) removing the link. A chat send runs afterregistry.notify.pushreturned anything butopted_outor a rate limit, like browser push, so the engine’s marketing suppression applies; a failing chat send never changes another channel’s result. - Storage: campaigns, stats, claims, runs and the queue live in plugin global storage; delivery records (
sent:<campaignId>:<occurrence>), cooldown markers and frequency-cap slots live in per-user storage. Delivery records and cap slots are reserved with an atomicmerge, so two nodes can never both send. - Jobs: one scheduler job,
dispatch(every 15 seconds, one node at a time), plans trigger runs, delivers due queue items (quiet-hour deferrals, tournament reminders), pages through running sends withusers.querycursors saved after every page, and prunes old data. A node that dies mid-send leaves a run that the next tick resumes. - Claims credit through
registry.wallet/registry.bonuswith the idempotency keyclaim:<campaignId>:<userId>:<occurrence>. - Player routes (
/api/v1/plugins/notifications):GET/POST /claims/:token, and (1.1.0)GET /reminders,PUT /reminders/:tournamentId,GET /refill,POST /refill(see Player tools for themes) (the/preferencesroutes were removed in API 1.3; per-userprefsrows from before are no longer read). Admin routes (/api/v1/admin/notifications):GET /overview,GET /deliveries?limit=,POST /campaigns,GET/PUT/DELETE /campaigns/:id,POST /campaigns/:id/enabled | test | send-now | run. - Realtime events to the player:
offer({ subject, link }) andclaimed({ token, type, amount }).
See also: Plugin notifications API, Users API, Wallet, Admin: Plugins.