Skip to main content

WordPress Chat Email Notifications: Customizable Templates and Smart Delivery

· 5 min read
Creator of Better Messages

Email notifications are the bridge between members who live in their inbox and a messenger they only open occasionally. Done badly, they spam — every message triggers a separate email and the recipient mutes the whole thing within a week. Done well, they batch intelligently, respect the user's online state, and look like part of your site's brand. Better Messages handles email notifications with smart grouping (one email per thread per batch window), online-state awareness (no email if the user was active in the last 10 minutes), and customizable templates (Simple visual mode, Custom HTML mode, or BuddyPress template integration).

Smart delivery (the part most chat plugins get wrong)

Better Messages does not email per-message. Instead:

  • Messages are grouped by thread and delivered in batches within the next 15 minutes via cron.
  • Users do not get an email for messages already marked as read.
  • Users do not get an email if they were online on the site in the last 10 minutes (no point — they are reading the thread live).
  • Users do not get an email if they have disabled email notifications in their profile.

The default behavior matches what consumer messengers do: batch chatty threads, skip if the recipient is already active. Members do not get spammed; they do not miss messages either.

Three template modes

Simple Mode (no code)

For sites that want a clean branded email without writing HTML, Simple Mode exposes visual controls:

  • Email Logo — upload an image displayed at the top of every email
  • Primary Color — buttons and links
  • Background Color — outer email background
  • Content Background Color — main content area background
  • Text Color — body text
  • Header Text — custom greeting with {{user_name}} placeholder
  • Footer Text — custom footer with {{site_name}} and {{site_url}} placeholders
  • Button Text — label for the "View Conversation" button

A live preview shows the email as you change settings.

Custom HTML Mode (full control)

For sites that want pixel-precise control or to match an existing email design system, paste a custom HTML template. Available placeholders:

PlaceholderWhat it renders
{{site_name}}Your website name
{{site_url}}Your website URL
{{user_name}}Recipient's display name
{{subject}}Conversation subject
{{messages_html}}The formatted batch of messages from this thread
{{thread_url}}Link to the conversation
{{email_subject}}Email subject line
{{unsubscribe_url}}Unsubscribe link

Click Load Default Template to start from a working template and edit from there.

BuddyPress Email Template (BuddyPress sites only)

If BuddyPress is active, the default template source is BuddyPress Email Template — Better Messages uses your existing BuddyPress email customizations (templates, branding, footer copy) for chat notifications. Members see one consistent email look across BuddyPress activity and chat notifications.

Switch to Simple or Custom HTML mode if you want chat emails to differ from your BuddyPress brand.

The Custom HTML mode supports an unsubscribe link via the {{unsubscribe_url}} placeholder. Clicking the link stops future chat email notifications for that user. (BuddyPress mode has its own unsubscribe mechanism.)

Test email

Use the Send Test Email button in settings to preview what your template looks like in a real inbox. Enter an email address, save settings first, then send — the email lands in seconds.

How to enable / customize

  1. WP Admin → Better Messages → Settings → Notifications → Email Notifications.
  2. Toggle email notifications globally (default: on).
  3. (BuddyPress sites) Pick Template Source: BuddyPress Email Template or Custom Template.
  4. (Custom Template) Pick Template Mode: Simple or Custom HTML.
  5. Configure colors / logo / text (Simple) or paste your HTML (Custom).
  6. Save and send a test email to verify.

Per-user preferences

Members can toggle email notifications for themselves in their profile settings. Site-level email-on / off is the default; the per-user toggle lets opinionated members opt out without affecting anyone else.

Free vs WebSocket version

Email notifications work identically on both versions:

FeatureFree versionWebSocket version
Smart grouping by thread (15-min batch)yesyes
Online-state awareness (skip if active in last 10 min)yesyes
Simple visual template modeyesyes
Custom HTML template modeyesyes
BuddyPress email template integrationyesyes
Unsubscribe linkyesyes
Per-user email-notification preferencesyesyes

Frequently asked questions

Why are emails delayed by up to 15 minutes?

The delay is intentional — it lets chatty threads batch into a single email instead of flooding the recipient. A 15-minute back-to-back conversation generates one email summarizing all messages in the thread rather than five separate emails.

Can I change the 15-minute window?

Yes — the cron interval is filterable in PHP. Smaller windows generate more emails; larger windows risk dropping urgent threads off the timely feed. 15 minutes is the sweet spot for most sites.

Will members receive an email for their own messages?

No — senders never get an email for their own messages. Only recipients of messages do.

What happens when a thread has many participants?

Each recipient who is offline (and has email notifications on) gets the batched email. Online recipients see the message in the messenger directly.

Does this work with the WordPress mail config (wp_mail / SMTP plugins)?

Yes — emails are sent through wp_mail(), so any SMTP plugin (WP Mail SMTP, Post SMTP, FluentSMTP) handles delivery. Configure your SMTP plugin once, all WordPress emails route through it including chat notifications.

Can I send a different template to different roles?

The template is global. For per-role variations, a custom filter on better_messages_email_template can pick a template by role.

See also

Install Better Messages from WordPress.org →