Unified Messaging — Overview & How to Use

Module: Unified Messaging v1.0.0

What is Unified Messaging?

Unified inbox for Facebook, Instagram, WhatsApp and Web Chat in Perfex CRM

This module installs into modules/unified_messaging/ and adds its own admin menus, permissions, and database tables — without editing Perfex CRM core files.

Who should use this module?

  • Admins — activate the module, configure Settings, assign roles, and manage integrations.
  • Operators / day-to-day staff — create and update records (orders, attendance, shipments, messages, etc.).
  • Managers / approvers — review queues, approve workflows, and monitor dashboards/KPIs.
  • Finance / compliance / ops leads — run reports, exports, and audit trails when the module supports them.

What you can achieve

  • Keep all related work in one place inside Perfex CRM instead of spreadsheets.
  • Control who can view, create, edit, approve, or export with role permissions.
  • Use dashboards and reports to see status, bottlenecks, and history.
  • Connect to other CRM data (customers, invoices, items, staff) where the module integrates.

Recommended learning path

  1. Read How to Install and activate the module.
  2. Skim Features so you know what screens exist.
  3. Complete the Quick Start checklist on this page (Settings → masters → first sample record).
  4. Open each screen guide under Screen-by-screen guides when you need step-by-step help.
  5. Check Version & Changelog after upgrades for new options.

Tip: Train one admin first, then create a limited role for operators so they only see the screens they need.

5-minute Quick Start

Follow this short path the first time you use Unified Messaging:

  1. Activate — Setup → Modules → activate Unified Messaging (run Upgrade if prompted).
  2. Permissions — Setup → Staff → Roles → enable view/create/edit (and approve/settings if needed) for this module.
  3. Settings — Open Unified Messaging → Settings and save company defaults, prefixes, and integrations.
  4. Master data — Create the first required masters (products, warehouses, templates, channels, accounts, routes, etc.).
  5. First transaction — Create one sample record end-to-end (save → submit/approve → complete) and confirm it appears in lists/reports.
  6. Cron — If the module uses alerts, sync, queues, or AI, confirm Perfex CRM cron is scheduled on the server.

Setup & usage notes from README

Setup

Web Chat

  1. Unified Messaging → Web Chat Widget
  2. Configure AI provider + API key
  3. Copy embed code to your website

Meta Channels (WhatsApp / FB / IG)

  1. Create Meta App at developers.facebook.com
  2. Unified Messaging → Channels → Add Channel
  3. Enter App ID, App Secret (required for webhook HMAC), Access Token, Page/Phone IDs
  4. Set webhook URL: {crm_url}/unified_messaging/unified_messaging_webhook/receive/{channel_id}
  5. Use the channel's Verify Token from channel settings

SLA & CSAT

  1. Unified Messaging → Settings
  2. Set first-response SLA minutes (default 15)
  3. Enable CSAT and customize the survey question
  4. Surveys are sent automatically when a conversation is marked resolved

Business Hours

  1. Unified Messaging → Settings → Business Hours
  2. Enable business hours, set start/end times and active days
  3. Customize the away message shown on the widget when outside hours
  4. Enable web chat and/or Meta channel away auto-replies

Widget Security

  • Allowed Domains: restrict which sites can use the widget
  • Rate Limit: max requests/minute per IP (default 30)
  • Max Message Length: default 2000 chars

Cron

Ensure Perfex CRM cron runs — processes:

  • AI reply queue
  • Failed send retries
  • SLA breach checks
  • Offline session cleanup
  • Auto-resolve stale conversations (+ CSAT survey)

Module documentation index

Start here — full guides for Unified Messaging:

How to use in Perfex CRM (daily operations)

  1. Sign in to the admin area with a role that includes Unified Messaging permissions.
  2. Open Unified Messaging (sidebar) or search for Unified Messaging in the admin menu.
  3. Start on the Dashboard (if available) to see open tasks, pending approvals, and KPIs.
  4. Review Settings after upgrades — new options may need defaults for your company.
  5. Create or import master data first; most modules block transactions until masters exist.
  6. Run the main business flow (create → submit → approve → post/complete) using the screens listed in Admin menu below.
  7. Use Reports / Analytics screens to reconcile stock, finance, compliance, or SLA metrics.
  8. For integrations (API, EDI, gateways, tax), confirm credentials in Settings and monitor logs or webhook delivery screens.
  9. Train staff with role-based access — give approvers approve permissions only, operators create/edit on their area.
  10. If something fails overnight, check Perfex CRM cron ran and open the module log / failed queue screen if present.

Admin menu — where to work

Open the Unified Messaging section in the admin sidebar. Screens your staff may use (depending on role):

  • AI Knowledge Base
  • Analytics
  • Audit Logs
  • Automation Rules
  • Block List
  • Bot Flows
  • Channels
  • Conversations
  • Inbox
  • Operations
  • Outgoing Queue
  • Quick Replies
  • Scheduled messages
  • Settings
  • Setup Wizard
  • Ticket Priority Critical
  • Ticket Priority High
  • Ticket Priority Low
  • Ticket Priority Medium
  • Unified Messaging AI Settings
  • Unified Messaging Analytics
  • Unified Messaging Audit Logs
  • Unified Messaging Automation
  • Unified Messaging Block List
  • Unified Messaging Channels
  • Unified Messaging Export
  • Unified Messaging Inbox
  • Unified Messaging Meta Templates
  • Unified Messaging Outgoing Queue
  • Unified Messaging Settings
  • Unified Messaging Templates
  • Web Chat Widget
  • Webhook failures
  • WhatsApp Templates

Detailed guide — features, workflows, API & FAQ

Features

  • Unified inbox with channel filters, staff assignment, CRM linking
  • Web chat widget with AI assistant (DeepSeek, Groq, OpenRouter, Together, OpenAI)
  • Meta webhook integration with HMAC signature validation
  • Async AI replies via cron queue
  • Auto-assign (round robin / default staff)
  • Media download for WhatsApp & Messenger
  • Outbound media send (image, video, PDF) from inbox
  • WhatsApp template message sending with optional components JSON
  • WhatsApp interactive button messages (CSAT)
  • Failed message retry queue (no duplicate rows on retry)
  • Widget rate limiting & domain allowlist
  • Encrypted AI API keys at rest
  • SLA first-response timers with breach alerts
  • CSAT surveys on conversation resolve
  • Analytics dashboard with CSAT and SLA metrics
  • SSE real-time inbox updates (toggle in Settings)
  • WebSocket real-time via Pusher / Soketi (optional alternative to SSE)
  • Business hours with away auto-reply (web chat + Meta channels)
  • Bulk inbox actions (status, assign, mark read, archive)
  • Agent performance analytics chart
  • Visual WhatsApp template parameter builder
  • Starred conversations, My conversations filter, manual CRM link

Phase 4–6 (v2.9.0 – v3.1.1)

  • AI Knowledge Base (RAG) — FAQs, PDF/TXT upload, vector + keyword search
  • Multi-provider embeddings — OpenAI, OpenRouter, Together, Custom (Auto fallback for DeepSeek/Groq chat)
  • Human handoff rules — trigger phrases pause AI, auto-assign staff
  • Bot flow builder — greeting → questions → handoff
  • Sentiment detection — keyword, AI, or hybrid modes with staff alerts
  • AI usage analytics — token counts and estimated cost
  • Inbox filters — sentiment label, AI paused only, resume AI button
  • WhatsApp multi-product list — send catalog product lists from inbox
  • Smart adaptive polling — slower updates when browser tab is hidden (SSE off)

Phase 2 (v2.7.0)

  • Automation rules engine — keyword triggers for auto-reply, assign, tag, lead, status, spam/block
  • Multi-step SLA escalation — configurable steps after first-response breach
  • Outgoing queue UI — view/retry/dismiss failed sends
  • Spam & block list — block by external ID, phone, or email
  • Conversation merge — bulk merge from inbox
  • WhatsApp 24h window badge — session status in inbox header
  • Per-channel business hours — override global away auto-reply per channel

Phase 3 (v2.8.0)

  • Meta template catalog sync — pull approved WhatsApp templates from Business Account
  • Template builder preview — visual preview + inbox picker from synced catalog
  • WhatsApp catalog products — sync and send single product messages
  • WhatsApp Flows — inbound nfm_reply and order message handling
  • Instagram story replies — story reply and mention detection
  • Voice message playback — inline audio player in inbox
  • Read receipts — delivered/read ticks on outbound messages

Setup

Web Chat

  1. Unified Messaging → Web Chat Widget
  2. Configure AI provider + API key
  3. Copy embed code to your website

Meta Channels (WhatsApp / FB / IG)

  1. Create Meta App at developers.facebook.com
  2. Unified Messaging → Channels → Add Channel
  3. Enter App ID, App Secret (required for webhook HMAC), Access Token, Page/Phone IDs
  4. Set webhook URL: {crm_url}/unified_messaging/unified_messaging_webhook/receive/{channel_id}
  5. Use the channel's Verify Token from channel settings

SLA & CSAT

  1. Unified Messaging → Settings
  2. Set first-response SLA minutes (default 15)
  3. Enable CSAT and customize the survey question
  4. Surveys are sent automatically when a conversation is marked resolved

Business Hours

  1. Unified Messaging → Settings → Business Hours
  2. Enable business hours, set start/end times and active days
  3. Customize the away message shown on the widget when outside hours
  4. Enable web chat and/or Meta channel away auto-replies

Widget Security

  • Allowed Domains: restrict which sites can use the widget
  • Rate Limit: max requests/minute per IP (default 30)
  • Max Message Length: default 2000 chars

Cron

Ensure Perfex CRM cron runs — processes:

  • AI reply queue
  • Failed send retries
  • SLA breach checks
  • Offline session cleanup
  • Auto-resolve stale conversations (+ CSAT survey)

API Endpoints (Admin)

EndpointMethodDescription
-------------------------------
conversationsGETList conversations (filters: assigned, starred, tag, etc.)
conversation/{id}GET/POSTView/update conversation (status, assign, tags, star)
sendPOSTSend text message
send_mediaPOSTSend image/video/PDF (multipart file)
search_crmGETSearch leads/customers for manual CRM link
create_leadPOSTCreate CRM lead from contact
create_ticketPOSTCreate support ticket
send_templatePOSTSend WhatsApp template (optional components JSON)
analyticsGETMessage analytics + CSAT + SLA + agent performance
streamGETSSE real-time updates (inbox)
export_conversationsGETCSV export (filtered)
export_ai_insightsGETCSV export of AI insights (days param)
export_conversation/{id}GETSingle conversation transcript CSV
schedule_sendPOSTSchedule outbound message (conversation_id, body, scheduled_at)
snoozePOSTSnooze/unsnooze conversation (conversation_id, preset or until)
add_notePOSTAdd internal note
resume_aiPOSTResume AI after handoff (conversation_id)
send_catalog_product_listPOSTSend WhatsApp multi-product list
bulk_updatePOSTBulk status/assign/mark read/archive
merge_conversationsPOSTMerge source conversations into target (target_id, source_ids)
block_contactPOSTBlock contact from conversation (conversation_id, optional reason)
meta_templatesGETSynced Meta templates + catalog products for channel
send_catalog_productPOSTSend WhatsApp catalog product (conversation_id, product_id)
link_crmPOSTLink contact to CRM

Real-Time Updates

When um_realtime_mode is set to SSE (default), the inbox uses Server-Sent Events. Choose WebSocket (Pusher/Soketi) for lower-latency push via a Pusher-compatible broker, or Polling only to disable push streams.

WebSocket (Pusher / Soketi)

  1. Unified Messaging → Settings → Real-time inbox mode → WebSocket
  2. Enter Pusher App ID, Key, Secret (or Soketi credentials)
  3. For self-hosted Soketi/Reverb: set custom host + port (default 6001)
  4. Ensure your WebSocket server is reachable from staff browsers and the CRM server can POST events to it

Changelog

See [CHANGELOG.md](CHANGELOG.md) for release notes.

v1.0.0

  • Initial CodeCanyon release by Nasbix Technologies
  • Full schema install on activation; clean uninstall removes all module tables and uploads

2. How to Use This Module

2.1 Setup Wizard

  1. After activation, open Unified Messaging → Setup Wizard (if shown).
  2. Enable the channels you need (Web Chat and/or Meta channels).
  3. Configure basic notification and AI options.
  4. Mark the wizard complete when finished.

2.2 Web Chat Widget

  1. Go to Unified Messaging → Web Chat Widget.
  2. Customize color, position, greeting, and offline message.
  3. (Optional) Configure AI provider + API key under Settings.
  4. Copy the embed script and paste it before </body> on your website.
  5. Optionally restrict domains under Settings → Widget Security.

2.3 WhatsApp / Facebook / Instagram (Meta)

  1. Create a Meta App at developers.facebook.com.
  2. In Perfex: Unified Messaging → Channels → Add Channel.
  3. Select channel type (WhatsApp, Facebook, or Instagram).
  4. Enter App ID, App Secret (required for webhook HMAC), Access Token, and Page / Phone Number IDs.
  5. Save the channel — note the channel ID.
  6. In Meta webhook settings, set the Callback URL to:
    {your_crm_url}/unified_messaging/unified_messaging_webhook/receive/{channel_id}
  7. Use the channel’s Verify Token from channel settings for Meta verification.
  8. Subscribe to the required messaging webhooks (messages, messaging_postbacks, etc.).

2.4 Unified Inbox

  1. Open Unified Messaging → Inbox.
  2. Filter by channel, assigned staff, starred, tags, sentiment, or snoozed.
  3. Reply with text or media (image / video / PDF).
  4. Assign conversations, add tags, create leads/tickets, or link CRM contacts.
  5. For WhatsApp outside the 24h window, send an approved template message.
  6. Mark conversations resolved — optional CSAT survey is sent automatically when enabled.

2.5 AI Assistant

  1. Go to Unified Messaging → Settings and enable AI.
  2. Choose a provider (DeepSeek, Groq, OpenRouter, Together, OpenAI, or Custom).
  3. Add your API key (stored encrypted).
  4. Optionally enable AI on Meta channels and configure handoff phrases.
  5. Add FAQs / documents under AI Knowledge Base for RAG answers.
  6. Build guided conversations under Bot Flows.

2.6 Automation, SLA & CSAT

  1. Automation — create keyword/event rules for auto-reply, assign, tag, lead, spam, handoff.
  2. SLA — set first-response minutes and multi-step escalation under Settings / Channels.
  3. CSAT — enable survey on resolve and customize the question.
  4. Business Hours — set global or per-channel away auto-replies.

2.7 Analytics & Operations

  • Analytics — message volume, CSAT, SLA, agent performance.
  • Operations — webhook health, queue stats, team workload.
  • Outgoing Queue — retry failed sends.
  • Webhook Failures — replay failed Meta payloads.
  • Scheduled Messages — send later from inbox.

3. Features

  • Unified inbox for WhatsApp, Facebook Messenger, Instagram DM, and Web Chat
  • Staff assignment, tags, notes, merge, snooze, spam/block
  • CRM linking: leads, customers, tickets
  • Web chat embed with domain allowlist and rate limiting
  • AI assistant with multi-provider support and encrypted API keys
  • AI knowledge base (RAG), bot flows, sentiment, human handoff
  • WhatsApp templates, catalog products, Flows, media send/receive
  • Automation rules engine with event triggers
  • SLA timers + multi-step escalation
  • CSAT surveys on resolve
  • Real-time inbox via SSE or Pusher/Soketi WebSocket
  • Analytics + operations dashboard
  • Clean uninstall removes all module tables and uploads

4. Permissions

Assign under Setup → Staff → Roles.

FeatureTypical capabilities
Inboxview, create, edit, delete
Channelsview, create, edit, delete
Templatesview, create, edit, delete
Settingsview, edit
Analytics / Operationsview
Automationview, create, edit, delete
Queue / Scheduled / Webhooksview, edit
AI / Knowledge / Bot Flowsview, edit
Audit / Exportview, export
Blocked contactsview, create, delete
Meta templatesview, edit

5. Cron Jobs

Background tasks use the main Perfex CRM cron. Example (every minute):

* * * * * php /path/to/perfex/index.php cron/index > /dev/null 2>&1

Cron powers: AI reply queue, send retries, SLA checks, scheduled messages, webhook failure retries, session cleanup.

Check Unified Messaging → Settings → System Health to verify cron and DB version.

6. Uninstall

  1. Go to Setup → Modules.
  2. Deactivate the module (optional — keeps data).
  3. Click Uninstall to permanently remove:
    • All um_* database tables
    • Related options
    • Files under uploads/unified_messaging/

Deactivate = keep data. Uninstall = delete all module data.

7. FAQ

Webhook verification fails

Confirm the Callback URL includes the correct channel ID and the Verify Token matches the channel settings. Ensure App Secret is saved for signature validation.

AI not replying

Enable AI in Settings, add a valid API key, confirm cron is running, and check that the conversation is not AI-paused / assigned in a way that blocks auto-replies.

WhatsApp template required

Outside the 24-hour customer care window you must send an approved WhatsApp template. Sync templates from your Meta Business Account first.

Widget not showing

Confirm the webchat channel is active, the embed script is on the page, and the domain is allowed if domain restriction is enabled.

After activation — configuration checklist

  1. Extract the download ZIP. You will see a folder named unified_messaging.
  2. Log in as admin → Setup → Modules.
  3. Find Unified Messaging and click Activate.
  4. Database tables and default settings are created automatically (schema version 100).
  5. Go to Setup → Staff → Roles and assign Unified Messaging permissions to your staff roles.
  6. Open the Unified Messaging sidebar menu and complete the setup wizard.
  7. Perfex CRM 2.3 or higher
  8. PHP 7.4+ (8.1+ recommended)
  9. MySQL 5.7+ / MariaDB 10.3+ (InnoDB)
  10. PHP extensions: mysqli, json, mbstring, curl, fileinfo
  11. Working Perfex CRM cron (required for AI queue, retries, SLA, scheduled messages)

Staff permissions (from module)

Assign under Setup → Staff → Roles. Each feature can expose different actions:

FeatureActions
Unified Messaging Inbox
um_inbox
view, create, edit, delete
Unified Messaging Channels
um_channels
view, create, edit, delete
Unified Messaging Templates
um_templates
view, create, edit, delete
Unified Messaging Settings
um_settings
view, edit
Unified Messaging Analytics
um_analytics
view
Unified Messaging Audit Logs
um_audit
view, export
Unified Messaging AI Settings
um_ai
view, edit
Unified Messaging Export
um_export
view
Unified Messaging Automation
um_automation
view, create, edit, delete
Unified Messaging Outgoing Queue
um_queue
view, edit
Unified Messaging Block List
um_blocked
view, create, delete
Unified Messaging Meta Templates
um_meta_templates
view, edit

One-time setup (first time only)

  1. Setup → Modules → activate Unified Messaging.
  2. Setup → Staff → Roles → assign Unified Messaging permissions (view, create, edit, delete, approve, export, settings as needed).
  3. Open Unified Messaging → Settings and complete company defaults, prefixes, integrations, and notification options.
  4. Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
  5. Enable Perfex CRM cron (php /path/to/perfex/index.php cron/index) for sync, retries, alerts, and scheduled jobs.
  6. Optionally enable REST API / webhooks in module settings if you integrate external systems.

Tips for success

  • Always configure Settings before creating live transactions.
  • Create master data (items, warehouses, templates, channels, accounts) first — most modules block incomplete records.
  • Use a test/sample record before going live with real customers or production stock.
  • Separate roles: operators create/edit; managers approve; finance/reporting get view/export only.
  • After any module upgrade, reopen Settings and confirm new options have sensible defaults.
  • If overnight jobs fail, verify Perfex CRM cron and check the module log / failed queue screen.

Common questions (FAQ)

Where do I find the module after activation?

In the admin sidebar look for Unified Messaging. If missing, your role may lack view permission — fix under Setup → Staff → Roles.

Do I need to edit core Perfex CRM files?

No. Keep all custom code under modules/unified_messaging/. Activate/deactivate from Setup → Modules.

What happens if I uninstall?

Deactivate keeps data. Uninstall usually removes module tables/options (see the Install article). Core customers, invoices, and items are not deleted by well-built modules.

Why can't my staff see a screen?

Almost always a permissions issue. Give the role at least view on that feature, then ask the user to log out and back in.

Reports/export buttons do nothing

Confirm the role has export (or view reports) permission, and that filters return at least one row. Try PDF/CSV from a wider date range.


Perfex CRM Knowledge Base — detailed usage guide generated from module README, HOW_TO_USE, and documentation.

Did you find this article useful?