Notifications

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

FieldMeaning
Name, categoryPromotions 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
EnabledDisabled campaigns never send (a paged send stops when its campaign is disabled)
TriggerSee Triggers
AudienceSeen 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)
ChannelsIn-app, push, email
ContentSubject (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)
RewardType and amount, Claim link valid (hours, default 72), and for bonuses the wagering multiplier and deadline
CooldownDays before the same player can get this campaign again (0 = no cooldown)
Quiet hoursFrom / 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

TriggerWho 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
ManualOnly 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

  1. Bots and blocked players are never contacted.
  2. The audience filters apply.
  3. The campaign’s cooldown (cooldown) and the audience’s "skip if contacted within" (recently_contacted).
  4. Quiet hours: deferred to the end of the window (deferred).
  5. 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).
  6. The global caps across all campaigns: Max campaign messages per player per day and per week (frequency_cap).
  7. 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.
  8. 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.

CampaignCategoryTriggerChannelsReward
Win-back 7 daysFree-chip offersInactive 7 days, cooldown 7In-app, push, email1,000 play chips
Win-back 30 daysFree-chip offersInactive 30 days, cooldown 30In-app, push, email5,000 play chips
Welcome day 0Promotions and newsRegistered, 0 hoursIn-app, emailnone
Welcome day 1Promotions and newsRegistered, 24 hoursIn-app, push, emailnone
Welcome day 3Promotions and newsRegistered, 72 hoursIn-app, push, emailnone
Daily free-chips reminderRemindersDaily 0 18 * * * UTC, players seen in 7 daysIn-app, pushnone
Out-of-chips refillFree-chip offersPlay chips below 100, cooldown 1In-app, push1,000 play chips (24 h to claim)
Tournament starting in 15 minutesRemindersTournament reminder, 15 minutesIn-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:

SettingDefaultMeaning
Max campaign messages per player per day3Across all campaigns (1-50)
Max campaign messages per player per week10Across all campaigns, the last 7 days (1-200)
Default timezoneUTCFor quiet hours and daily campaigns that name none
Sender nameThe Poker RoomShown in the claim dialog; {{senderName}} in texts
Claim page title / textYour 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 emailoffA transactional email after each claim
Browser (web) pushoffLets players get the push channel in their browser (see below)
Web push VAPID public key / private keyemptyThe key pair browsers’ push services check; the private key is stored encrypted
Web push contactemptyA mailto: address or https: URL the push services can reach you at
Site address for chat linksemptyThe https address of this site; Telegram and Discord messages link to it (empty leaves the link out)
Telegram notificationsoffLets players link Telegram (see Telegram and Discord below)
Telegram bot token / bot usernameemptyThe bot that sends; the token is stored encrypted and never shown again
Discord notificationsoffLets players link Discord
Discord bot token / application ID / client secretemptyThe 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:

  1. Generate a key pair: on the Notification campaigns page, or with POST /api/v1/admin/notifications/web-push/vapid-keys (it returns publicKey and privateKey and stores nothing).
  2. 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>/notifications as 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/preferences redirects there.

Player tools for themes (1.1.0)

  • Remind me. GET /reminders returns { available, minutesBefore, tournamentIds } (available while 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 from tournament: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: 409 REMINDERS_UNAVAILABLE, TOO_MANY_REMINDERS; 400 INVALID_START.
  • Out-of-chips refill. GET /refill returns { available, amount, threshold, ready, reason, nextAt } for the first enabled low-balance campaign with a play-chip reward; POST /refill pays 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: 409 REFILL_UNAVAILABLE, REFILL_NOT_NEEDED, REFILL_CLAIMED, and the claim errors.

For developers

  • Categories: registry.notify.registerCategories on load (promotions and free-chips with marketing: true, reminders, each on in-app, push and email); every send passes the campaign’s category, 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 as promotions.
  • Slot fills: notifications.item.actions (the Claim button, for source === 'plugin:notifications' with metadata.claimToken, or a pre-1.3 claim link) and notifications.top (the claim dialog for ?claim=<token>). The in-app message carries the token as data: { claimToken }, and push data carries it too. Manifest redirects forward /ext/notifications/preferences and /ext/notifications/claim/:token. The admin page is listed with nav.section: 'marketing'.
  • Browser push: player routes GET /web-push ({ available, publicKey, subscriptions }), POST /web-push/subscriptions (the browser’s PushSubscription JSON) and POST /web-push/unsubscribe { endpoint? }; subscriptions live in per-user storage (webpush, at most five). A campaign push goes to the browsers after registry.notify.push returned anything but opted_out (or a rate limit), encrypted per RFC 8291 and signed with VAPID (RFC 8292) using node: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 routes GET /chat, POST /chat/link { service, redirectUri? } (a single-use 32-hex code, 10 minutes: the Telegram deep link https://t.me/<bot>?start=<code>, or the Discord OAuth2 state), POST /chat/discord/complete { code, state, redirectUri }, POST /chat/unlink { service } and PUT /chat/categories. Telegram links are completed by the chat-poll scheduler job (getUpdates, private chats only, offset in global storage), so there is no inbound webhook to authenticate. Per-user storage chat holds 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 to api.telegram.org and discord.com over https, with a 5-second time-out, at most three attempts with 250/500 ms backoff, a 429 retry_after of up to 5 seconds honoured (a longer one skips the message), and a Telegram 403 (bot blocked) removing the link. A chat send runs after registry.notify.push returned anything but opted_out or 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 atomic merge, 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 with users.query cursors 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.bonus with the idempotency key claim:<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 /preferences routes were removed in API 1.3; per-user prefs rows 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 }) and claimed ({ token, type, amount }).

See also: Plugin notifications API, Users API, Wallet, Admin: Plugins.

Try the live demo Pricing

Have questions about Poker Engine? We reply fast.