Executive Summary in Plain Everyday English (No Technical Jargon)
For business owners, sales managers, and non-technical clients: How custom plans, quotas, and renewals work in simple real-world terms
Like a Fixed Restaurant Combo Meal
"Combo Meal A" comes with 1 burger, 1 small fries, and 1 soda. You cannot ask the counter to give you 5 burgers for the same combo price. In Ctrl TASQ, standard plans have fixed limits (like 1 agent seat) designed for solo freelancers and single users.
Like Leasing a Customized Private Office Suite
A growing company needs: 5 staff desks (5 agent seats), 2 official company phone lines (2 WhatsApp lines), and 20 brand social pages. You negotiate a tailor-made contract (e.g., ₹8,500/month) specifically for their business.
The Old Glitch Explained in Plain Words (The Absent-Minded Receptionist)
Imagine a VIP client pays for a 5-person private office suite. But when the receptionist files their registration paperwork, they accidentally tag it with a standard "1-Person Single Desk" folder.
The next morning, the client arrives with their 5 team members. The security guard scans their badge, looks at the folder, and says: "Sorry! Your file says 1 desk only. Only 1 person can enter; the other 4 must stay outside!"
The Simple Fix: Don't give them a standard folder. Give them their own dedicated VIP Private Contract Folder labeled "5 Desks & 2 Phone Lines". The security guard opens the doors, and all 5 staff walk right in!
What Happens When Month 1 Ends? (The 2 Everyday Scenarios)
Just like paying your monthly postpaid phone bill:
- 5 Days Before Expiry: An invoice email arrives: "Your monthly bill of ₹8,500 is ready".
- Customer Clicks "Pay Bill": (UPI, Credit Card, NetBanking).
- Result: Their 30-day service clock automatically extends for another month. Their 5 staff keep chatting, their 2 WhatsApp lines stay live, and not a single customer message is interrupted.
Their business grew and they hired 5 more agents:
- Customer Clicks "Upgrade Plan": In their portal, they choose 10 Staff Seats and 5 WhatsApp Lines.
- Admin Quotes New Rate: You say: "For 10 staff and 5 lines, the new price is ₹14,500/mo".
- Customer Pays Online: Instantly, their office room limit expands from 5 to 10 seats!
- Result: The manager immediately clicks "+ Add Staff" to create logins for their 5 new team members.
How Staff Seats & Permissions Work (In Plain English)
₹499 Support Seat Calculator
Available on ANY plan: Like hiring a single receptionist whose only job is to answer customer complaints in the ticket office. Staff login at /agent/login and strictly see Assigned Tickets.
3 Team Seats (Growth Plan)
Included FREE in Growth Plan (₹4,999): 1 Boss + 2 Teammates. The boss can invite a Sales Rep (CRM + WhatsApp) or a Marketer (Social Media + AI Studio) via their /team dashboard.
5–50+ Seats & Multiple Phone Lines
For Agencies & Companies: Negotiate 10 seats + 2 WhatsApp numbers. Line 1 connects to the Sales Desk; Line 2 connects to Support. Each team only sees their own assigned tools.
The Boss's Private Safe (How We Hide API Keys & Invoices from Staff):
If you give your receptionist a desk, you give them a telephone and an appointment notebook. You never give them the combination to the office safe where banking cards and master passwords are kept!
In our system, both the Boss and the Staff member visit /whatsapp_business. But the web server checks who is logging in: The server physically refuses to send the "Meta API Keys" and "Wallet / Billing" tabs to the employee's screen. Even if the employee knows how to inspect code in Chrome, the keys are 100% physically absent from their computer!
1. End-to-End Lifecycle of a Custom Plan Request
How a visitor request on /custom-quote travels through the system
/admin/.../quote/:id, sets price & toggles modules/custom-plan/payment/:token2. Complete Feature Audit (All 8 Categories on New Page)
Comparing each module on /custom-quote with the CodeIgniter 4 backend
| Category & Features | Underlying Module | Status | How It Operates When Granted |
|---|---|---|---|
|
1. WhatsApp Business Suite Meta Cloud API, Templates, Broadcasts, Chatbot, Catalog, Widget, Escalation |
whatsapp_business
|
100% Working |
Activates full access to /whatsapp-business. User connects their Meta WABA, creates message templates, launches broadcasts, configures visual chatbots, and embeds chat widgets.
|
|
2. WhatsApp Web Automation Multi-device QR Pairing, Bulk Web Sender, Scraper |
whatsapp_web
|
100% Working |
Activates /whatsapp-web. Powered by Playwright/Node engine. User pairs physical phones via QR code and runs contact exports and automated web messaging.
|
|
3. AI Telecalling & Voice Studio Autonomous Inbound/Outbound, Sub-second Latency, Appointment Booking, DNC |
ai_telecalling
|
100% Working |
Unlocks /telecalling in sidebar. User configures neural voice agents, writes dialogue scripts, manages DNC numbers, and executes calling campaigns.
|
|
4. Helpdesk & Support Ticketing Agent Workspace (/agent/workspace), Shared Inbox, Round-Robin, SLA |
tickets
|
100% Working |
Provides access to ticket management, agent status routing (Online/Away), internal collaboration notes, and agent logins at /agent/workspace.
|
|
5. Social Media Automation 9 Channels (FB, IG, LinkedIn, X, YT, Pinterest, Telegram, GMB, Threads), Calendar, CSV |
social_accounts, post_management
|
100% Working | Enables multi-platform OAuth account connection, visual drag-and-drop calendar scheduler, bulk CSV import, and unified analytics. |
|
6. Sales CRM & Pipeline Multi-Pipeline Kanban, Deal Values, Automation Workflows, 360 Contact Profiles |
crm_pipeline, crm_automations, crm_tasks
|
100% Working | Unlocks visual Kanban deal stages, revenue probability calculators, automated triggers on lead movement, and shared task calendar. |
|
7. AI Content Studio Multi-LLM Copywriter (GPT-4o, Claude, Gemini), AI Image Generator, Hashtag Finder |
ai_content
|
100% Working |
Provides access to /ai suite. Generates social captions, blog outlines, marketing graphics, and viral hashtag suggestions.
|
|
8. Lead Gen & Builder Tools (Full Suite) • Visual Page Builder ( /landing-pages)• Automation Forms ( /forms)• Captured Leads Hub ( /landing-pages/leads)• Sales CRM Pipeline Sync ( /crm/pipeline)• Classifieds OCR Extractor: Upload & Batches ( /classified-extractor)• Dynamic Lifetime QR Codes ( /qrcodes)
|
landing_pages, forms, classified_extractor, qr_codes
|
100% Working | Enables the entire Lead Gen suite from the sidebar: visual drag-and-drop page builder, standalone multi-step automation forms, centralized lead repository with CSV exports, direct Kanban pipeline deal creation, print newspaper OCR batch extractor, and dynamic QR generator. |
|
9. White-Label & Enterprise Custom Domain, Agency Logo, Favicon, Color Themes, Role-Based Access Control |
whitelabel
|
100% Working |
Unlocks /whitelabel. Agency owners configure custom domain CNAME, upload custom logo and favicon, and adjust client tenant access.
|
3. Quota & Volume Limit Audit (What Needs Attention)
Evaluating the capacity selectors chosen by the customer
| Capacity Selector | Customer Choices | Current Code Status | Gap Analysis |
|---|---|---|---|
| Support Agent Seats | 1, 3, 5, 10, 25+ Seats | Quota Gap |
The restriction code in Front.php:18865 works, but it reads tbl_plans.included_agent_seats from a default base plan ($basePlanId = 10). If customer paid for 5 seats, they are currently restricted to the base plan's 1 seat.
|
| Total Social Channels | 1 to 100 Channels | Quota Gap |
Channel limits in PermissionService.php:1401 read tbl_plans.platform_channel_limits. Needs custom channel count applied to the user's active plan.
|
| Monthly Posts Volume | 100, 500, 2,000, Unlimited | Quota Gap |
Currently inherits the base plan's post quota from tbl_plan_feature_values rather than the custom paid amount.
|
| WhatsApp Phone Lines | 1, 2, 5, 10+ Lines | Architectural | Meta Cloud API stores 1 active phone number per user login. 2 or 5 lines are allocated to Sub-Accounts / Agent Logins (1 number per branch or department). |
| AI Telecalling Minutes | 0, 500, 1,500, 5,000 Mins | Architectural | Currently tracked via daily campaign limits (e.g. 100 calls/day). An exact minute-by-minute countdown balance wallet is not yet in the schema. |
Team Seats, Roles & Security Ecosystem
How Helpdesk Seats (₹499), Growth Plan Collaboration (3 Seats), and Custom Enterprise Teams operate, what is currently in code, and how we make it 100% user-friendly and secure.
3.1 The 3-Tier Team & Agent Ecosystem (Understanding the 3 Products)
In Ctrl TASQ, staff delegation is designed across three distinct commercial and technical tiers. Each serves a specific customer requirement without overlapping or causing confusion:
Agent Seat Calculator
Built specifically for businesses needing Helpdesk Support Agents to answer customer tickets. Purchased on-demand via the pricing modal.
- Quota: 1 Seat = 1 Dedicated Support Agent
- Login URL:
/agent/login→/agent/workspace - Scope: Helpdesk Tickets Queue only
3 Team Seats (Growth Plan)
Bundled into the Growth Plan for full cross-department business collaboration. The owner can delegate Marketing, Sales, or Support.
- Quota: 3 Seats (1 Account Owner + 2 Team Invites)
- Login URL:
/agent/loginor unified/login - Scope: Dynamic Sidebar (Tools assigned by Boss)
Custom Plan Teams
For larger organizations needing 5, 10, 25+ seats plus Multiple WhatsApp Phone Lines with department-level message routing.
- Quota: Tailored (e.g. 10 Seats, 2 WhatsApp Lines)
- Login URL:
/agent/loginwith Department Routing - Scope: Sales gets Line 1, Support gets Line 2
Side-by-Side 3-Tier Comparison Matrix:
| Dimension | Tier 1: Solo Add-On (Seat Calculator) | Tier 2: Growth Plan Bundle | Tier 3: Custom Enterprise Plan |
|---|---|---|---|
| Commercial Model | Standalone Modular Add-on | Bundled Feature inside Plan | Negotiated Tailor-Made Contract |
| Price | ₹499 / seat / month (or ₹414 yearly) | ₹0 FREE (included in ₹4,999/mo plan) | Custom Quote (₹8,500 – ₹25,000+) |
| Seat Capacity | Dynamic (1, 2, 5, 10+ seats chosen) | Fixed: 3 Seats (1 Owner + 2 Staff) | Custom Scale: 5 to 50+ Seats |
| Target User | Any subscriber on any plan wanting tickets | Growing businesses delegating work | Mid-to-large businesses and agencies |
| Primary Modules Accessible | Support Tickets Queue Only | Any Tool Assigned by Owner | Full Enterprise + Multi-Line Routing |
| WhatsApp Phone Lines | Shared Owner's 1 Line | Shared Owner's 1 Line | Multiple Lines (e.g. 2, 5, 10 Lines) |
| Can They Buy Extra Seats? | Yes (adds more seats @ ₹499/mo) | Yes (+₹499/mo per seat if > 3 needed) | Yes (via instant quote or +₹499/mo) |
| Staff Login Portal | /agent/login → /agent/workspace |
/agent/login → Dynamic Filtered Workspace |
/agent/login → Department Scoped Workspace |
3.1.1 How Support Tickets & Team Members Work Across All 3 Plan Types
Below is the exact real-world operation of how a customer uses the Support Ticket System and Team Members System depending on whether they subscribe to a Standard Plan, Professional Growth Plan, or a Custom Plan:
- Default Behavior: The solo business owner resolves their customer support tickets personally inside their main dashboard.
- Need dedicated agents? They can purchase dedicated support seats via the ₹499 Agent Seat Calculator (e.g. 1 seat for ₹499/mo, 2 seats for ₹998/mo).
- Agent Login: Support agents log in at
/agent/loginand strictly see Assigned Tickets inside/agent/workspace. They cannot access CRM, WhatsApp, or billing.
- Included Seats: 0 Seats (Solo account for 1 user only).
- Access to
/team: If they visit/team, the page gracefully informs them: "Team Collaboration requires a Professional Growth Plan or Custom Plan. Upgrade to invite marketing and sales staff, or purchase a Support Ticket Seat for ₹499/mo." - No Cross-Department Roles: Cannot invite general teammates for social media or calling unless upgraded.
- Included in Plan: The owner can handle tickets themselves, OR they can assign one of their 3 included seats to be a dedicated Support Agent!
- Permission Setup: In the
/teaminvite modal, the owner checks[✓] Support Tickets Queue. - Need more than 3 staff? They don't need to change plans — they simply buy additional seats on-demand using the ₹499 Seat Calculator.
- Included Seats: 3 Total Seats INCLUDED FREE (1 Owner + 2 Team Invites). Listed as "Team Members & Collaboration : 3".
- Role Allocation: Owner can assign 1 seat to Sales (WhatsApp + CRM) and 1 seat to Marketing (Social Media + AI Studio).
- Dynamic Sidebar: Staff log in at
/agent/loginor/login; their sidebar dynamically only displays the tools they were assigned. - Bulletproof Privacy: Server-side PHP blocks staff from seeing Meta API keys, Webhook secrets, or Billing invoices.
/custom-quote)
Enterprise Agency Model
- Department Scale: Can have 5, 10, or 20+ dedicated support agents resolving customer tickets simultaneously.
- Multi-Line WhatsApp Routing: Custom Plans support Multiple Official WhatsApp Lines (e.g. 2, 5, 10 lines). The business dedicates Line 2 (+91-91234-XXXXX) exclusively for Customer Support.
- Automated Routing: Incoming customer WhatsApp chats to Line 2 automatically flow into the Support Desk queue for the support agents.
- Included Seats: Custom Tailored Quota (5, 10, 25, 50+ Seats) stored in
tbl_plans.included_agent_seats. - Multi-Department Segmentation:
• Sales Desk (5 reps): WhatsApp Line 1 + CRM Deals Pipeline.
• Support Desk (5 agents): WhatsApp Line 2 + Support Tickets.
• Telecalling (3 reps): AI Voice Dialer & Call Queues.
• Marketing (2 reps): 50 Social Channels + AI Post Studio. - Month 2 Scaling: If they hire 5 more staff, they can upgrade to 15 seats with 1 click, or buy individual add-on seats at ₹499/mo!
3.2 Honest Codebase Audit: What Currently Works vs. What Needs Enhancement
We conducted a line-by-line inspection of the actual controllers, views, and database models. Here is the transparent engineering audit:
What Already Works in the Code:
- Addon Seat Calculator (
pricing.php:690-780): Dynamically calculates ₹499/seat and routes toticket/checkout. Activates viaTicketService::purchaseHelpdeskSeatsintouser_addons(addon_slug = 'support_ticketing_seat'). Open to all plans. - Growth Plan Feature ID 7 Detection (
Front.php:18863):Front::teamcheckstbl_plan_feature_values.feature_id = 7. Successfully unlocks/teamfor Growth Plan subscribers. - Custom Plan Seat Quota Check (
Front.php:18865): Successfully checkstbl_plans.included_agent_seatsfor private custom plans. - Login Router Redirect (
Front.php:2212): When an email belongs tosupport_team_members, it successfully redirects them to/agent/workspace.
What Is Currently Missing / Broken:
- Dummy Role Values in
team/index.php:279-283: In the "Add Member" modal, all 3 options (Support, CRM Sales, Telecalling) have the exact same hardcoded value:value="market-team"! It saves to theadmintable without saving any granular permissions. - Split Database Tables: Support agents live in
support_team_members, while Growth team members live inadmin. There is no unified permission column. - Workspace Hardcoded to Tickets:
/agent/workspaceonly renders Support Ticket HTML. It cannot display WhatsApp or CRM. - No Tab-Level Protection on Multi-Tab Pages: In
whatsapp_business/index.php, live chat tabs and sensitive owner tabs (Meta API credentials, billing) live in the same file without role guards.
View Actual Code Snippet: The Dummy Role Dropdown in app/Views/front/team/index.php (Click to Expand)
3.3 The User-Friendly Dashboard & "Add Team Member" Modal
When the business owner opens Team Management (/team), the interface should be effortless, self-explanatory, and visual:
Team Collaboration & Department Workspaces
Visual Mockup: The Enhanced "Add Team Member" Modal:
Add Team Member
3.4 Staff Login Experience: /agent/login with Dynamic Filtered Sidebar
When Rahul logs in, the platform customizes his view entirely based on what his boss allowed. He does not see an empty or broken dashboard:
How the Controller Enforces This:
- Unified Authentication (
/agent/loginor/login): Rahul logs in withrahul@company.com. The system detects he is a staff member under Acme Corp (User #104). - Loads Permission Array: Session stores
is_staff_agent = trueandallowed_modules = ["whatsapp", "crm"]. - Automatic Multi-Tenant Data Scoping: When Rahul views WhatsApp or CRM leads, queries automatically scope to
WHERE user_id = 104(Acme Corp). Rahul sees Acme's leads, not someone else's. - Zero Access to Other Modules: If Rahul attempts to type
/social-mediaor/telecallingin his browser address bar, the controller intercepts and redirects back with: "Access Denied: Module not assigned".
3.5 100% Security Protection: Hiding Sensitive Tabs (API Credentials & Billing)
"If a staff member is given WhatsApp Live Chat, how do we restrict them from seeing the Meta API credentials, Webhook tokens, and Wallet Billing tabs when all of them are inside the exact same page (whatsapp_business/index.php)? Will it be an easy change?"
The Answer: Yes, it is an easy 10-line change, and it is 100% physically hack-proof!
Here is the difference between an amateur approach (CSS hiding) and our professional architecture (Server-Side PHP Rendering):
display:none
If we just hid the billing tab using CSS (style="display:none"), the HTML with the Meta API Token, App Secret, and credit recharge buttons would still be sent to Rahul's browser. Any tech-savvy employee could open Chrome Developer Tools → Inspect Element, uncheck display:none, and steal the API keys!
In our CodeIgniter 4 view, we wrap sensitive tabs in <?php if (empty($isStaffAgent)): ?>. Because this check executes on our Apache server before anything leaves the server, the HTML for API keys and Billing is never generated for staff. It physically does not exist on Rahul's computer!
What the Boss Sees vs. What the Staff Sees on /whatsapp_business:
| Tab in View File | Business Owner (Boss) | Staff Member (Rahul) | Security Mechanism |
|---|---|---|---|
Live Chat (#tab-chat) |
✅ Visible (Answer chats) | ✅ Visible (Answer assigned chats) | Shared Operational Tab |
Contacts (#tab-contacts) |
✅ Visible (Full CRM list) | ✅ Visible (Customer phone numbers) | Shared Operational Tab |
Templates (#tab-templates) |
✅ Visible (Create & submit) | ✅ Visible (Send approved templates) | Shared Operational Tab |
Connect & API Keys (#tab-connect) |
✅ Full Setup Access | ❌ 100% OMITTED BY SERVER | <?php if (empty($isStaffAgent)): ?> |
Billing & Limits (#tab-billing) |
✅ Wallet Top-up & Invoices | ❌ 100% OMITTED BY SERVER | <?php if (empty($isStaffAgent)): ?> |
View the Exact 10-Line Code Change in app/Views/whatsapp_business/index.php (Click to Expand)
3.6 Custom Plan Multi-Line WhatsApp Routing (Assigning Phone Numbers to Departments)
For Custom Enterprise subscribers who negotiate 2, 5, or 10 official WhatsApp phone numbers, Ctrl TASQ allows assigning individual phone lines directly to specific teams or departments:
app/Controllers/WhatsAppWebhook.php), incoming messages contain metadata.phone_number_id. The controller queries tbl_whatsapp_lines to check which department or team members are bound to that Phone ID, and routes the incoming conversation specifically to their inbox!
4. Core Principle: Standard Plans vs. Custom Tailored Plans
Why custom plans should NEVER match or be tied to off-the-shelf standard plans
| Dimension | Standard Public Plans (Starter, Pro, Growth) | Tailor-Made Custom Plan |
|---|---|---|
| Target Audience | General website visitors & self-serve buyers. | Single specific enterprise customer (exclusive negotiated contract). |
| Pricing Model | Fixed, public catalog pricing (e.g., ₹999, ₹2,499, ₹4,999). | Negotiated custom quote (e.g., ₹18,500 based on exact usage). |
| Quotas & Limits | Fixed by admin in tbl_plans (e.g., 1 agent seat, 3 social channels). |
Custom scale (e.g., 5 agent seats, 25 social channels, 2 WhatsApp lines). |
| Visibility | Publicly listed on https://ctrltasq.com/plans. |
100% Private & Hidden from public view. |
| Independence | Admin can edit limits anytime for all future public signups. | Must remain completely isolated—editing public plans must NEVER affect a custom client's contract! |
The Critical Risk of Matching Them:
If a custom VIP client who paid for 5 seats is tagged with the standard off-the-shelf Growth Plan, two major problems occur:
1. Short-changing the client: The client paid for 5 seats, but the system forces the standard Growth package's 1-seat limit on them!
2. Accidental breakage: If admin changes the public Growth plan pricing or features in the admin panel next month, it would accidentally break or alter this enterprise client's account!
5. Root Cause: Why Did This Happen in the Code?
Examining the original shortcut in CustomPlanService.php lines 653–678
When the custom plan payment handler in app/Services/CustomPlan/CustomPlanService.php was initially created, the developer's main focus was:
- Verifying the Razorpay/Stripe payment transaction.
- Generating the official invoice number (
INV-2026-XXXXXX). - Auto-registering the user account and emailing their temporary password.
- Enabling their module access permissions via
user_module_permissions.
However, several older parts of the application (like Front.php, PermissionService.php, and Dashboard) require a plan_id in tbl_user_subscriptions and membership_details to prevent SQL NULL errors.
In Everyday Words: What Happened Here?
Think of the computer as an absent-minded receptionist. The VIP customer paid for a 5-person private office suite. But when filing their paperwork, the receptionist accidentally reached for a standard 1-person desk folder (called "Plan #10" in the filing cabinet).
When the customer brings their 5 team members to work, the security guard opens the folder, reads "1 desk allowed", and stops Staff 2, 3, 4, and 5 at the front door!
Below is the temporary fallback code the developer wrote to prevent a database crash, which caused this mix-up:
View Developer Code Behind This (Click to Expand)
6. Exact Code Implementation: The Private Isolated Plan Architecture
How to make custom plans independent, automated, and permanent
To ensure custom clients get their exact quotas without ever touching or interfering with your standard public plans, we implement the Dedicated Private Plan Pattern:
Store the Negotiated Quotas in custom_plan_quotes Table
Add columns to the quote table so the admin record permanently remembers the agreed seats, channels, and WhatsApp numbers:
View SQL Schema Update (Click to Expand)
Display & Confirm Quotas in Admin Quote Builder
In app/Views/admin/custom_plans/quote_builder.php, show inputs pre-filled with the exact numbers the customer selected on /custom-quote:
View View Template HTML (Click to Expand)
Auto-Provision Dedicated Private Plan upon Payment
When the customer completes their payment, the system creates a brand-new, isolated VIP private contract folder just for them:
View Backend Controller Code (Click to Expand)
1. 100% Isolated: It has
status = 'custom_private', so it never appears on the public pricing page.
2. Zero Code Breakages:
Front.php, PermissionService.php, and the dashboard naturally read included_agent_seats = 5 and platform_channel_limits = 20 without modifying any other files!
3. Complete Protection: If admin changes the public Growth plan to ₹6,999 or 2 seats tomorrow, this client's account remains 100% untouched.
7. Month 2 & Beyond: Renewals, Upgrades & Expiration Lifecycle
How custom plan clients renew their 30-day term, upgrade quotas (e.g. 5 → 10 agent seats, 2 → 5 WhatsApp lines), or handle renewals
When a customer purchases a custom plan, their subscription is initialized for an active 30-day billing cycle. At the end of Month 1, there are three clear operational paths based on the customer's business needs. Below is the exact technical and operational breakdown of each scenario.
Standard Monthly Renewal
Client continues their exact same custom plan (5 seats, 2 lines, 20 channels). 1-click invoice payment extends subscription +30 days with zero disruption.
Quota Upgrade / Scaling Up
Client scales their team from 5 → 10 agent seats and 2 → 5 WhatsApp lines. Admin revises pricing, client pays, and extra capacity unlocks immediately.
Downgrade to Public Plan
Client chooses to downscale to a standard public plan (e.g., ₹1,499 Pro Plan). Subscription switches plan ID and extra seats pause gracefully.
The client loves their custom setup (e.g. 5 Agent Seats, 2 WhatsApp lines, 20 Channels at ₹8,500/month) and wants to continue working into Month 2 without any changes.
Day 25: Automated Renewal Invoice Sent
5 days before Month 1 expires, the system generates a renewal invoice in tbl_invoices for ₹8,500 and sends an automated notification email with a secure payment link: "Your monthly Ctrl TASQ Enterprise renewal is ready for payment".
Day 25–30: Client Pays In Dashboard or Email
The client clicks the link or logs into their dashboard at /invoices, clicks [ Pay Invoice ], and completes payment via UPI, NetBanking, Credit Card (Razorpay/Stripe), or Offline Bank Transfer.
Instant Auto-Extension (+30 Days)
The payment webhook automatically advances their subscription end date by +30 days:
View Extension Code (Click to Expand)
What Happens to Their Data & Agents?
- All 5 Agent Seats: Support agents remain logged in and active; tickets and chat assignments are never paused.
- All 2 WhatsApp Phone Lines: Meta Cloud API webhooks and live sessions remain 100% active.
- All 20 Social Channels: Facebook, Instagram, LinkedIn OAuth tokens stay verified without reconnecting.
- Campaigns & Workflows: All scheduled posts and automated telecalling campaigns run smoothly without a single second of downtime.
The client's business grew rapidly during Month 1. They hired 5 more customer support reps and added 3 more marketing numbers. Now they need 10 Agent Seats and 5 WhatsApp Phone Lines (just like the volume selectors on the /custom-quote page).
Step 1: Client Submits Upgrade Request
In their dashboard under Plans & Subscription → Custom Plan, the client clicks [ Upgrade Capacity / Request More Seats ] (or opens /custom-quote while logged in). They select:
10 Support Agent Seats
5 WhatsApp Phone Lines
5,000 AI Voice Minutes
Step 2: Admin Reviews & Quotes Upgrade in Admin Portal
In /admin/custom-plans, admin sees the quote request flagged as [UPGRADE REQUEST - User #104 (Acme Corp)]. Admin enters the new negotiated price (e.g., ₹14,500/month) and clicks "Send Revised Quote".
Step 3: Client Approves & Pays
The client visits the checkout page at /custom-plan/checkout/{quote_number}, sees the itemized upgrade details (10 Agent Seats + 5 WhatsApp Lines - ₹14,500/mo), and pays online.
Step 4: System Automatically Expands the Customer's Dedicated Private Plan
Upon payment confirmation, the system updates the customer's private room limits:
View Upgrade Code (Click to Expand)
The Result: Zero Reloads, Instantly Active
When the admin or team lead returns to the Agent Workspace (Front::agentWorkspace), the seat counter immediately changes from "4/5 Seats Used" to "4/10 Seats Used". They can immediately click "+ Add Agent" to invite Agent 5, 6, 7, 8, 9, and 10!
If a client completes their seasonal project and decides they no longer need 5 agents or custom lines, they can self-serve a downgrade at any time:
- The client visits the public pricing page at
/plans. - They choose the standard Pro Plan (₹1,499/mo) and pay online.
- The customer's subscription switches from their custom plan to the standard Pro Plan (1 Agent Seat, 3 Social Channels).
- Graceful Seat Management: Since the Pro plan includes 1 seat, Agent #1 (primary admin) remains active. Agents 2–5 are flagged as
paused(their past chat transcripts and tickets remain fully preserved in database history).
The Expiration & Grace Period Safety Net (Zero Panic Policy)
What if Day 30 arrives and the client's accounting department hasn't processed the renewal invoice yet? Nothing is deleted or wiped!
The client can still log into https://ctrltasq.com. They can read all previous customer chats, export lead contacts, and access the invoice page to pay.
Meta WhatsApp Cloud API tokens, WhatsApp Web paired sessions, and Facebook/Instagram OAuth permissions remain securely saved in the database. When renewed, everything resumes automatically!
What the Client Sees Inside Their Dashboard
Here is the exact dashboard experience for a custom plan subscriber, showing real-time quota consumption and 1-click renewal/upgrade triggers:
Omnichannel Enterprise Scale (Custom Private Package)
Real-World Plan Lifecycle: Month 1 vs Month 2 (In Plain Words)
| Lifecycle Stage | Package & Price Paid | What the Customer & Staff Experience | What Happens Behind the Scenes |
|---|---|---|---|
| Month 1 (Initial Order) |
Custom VIP Package
₹8,500 / month 5 Seats • 2 WA Lines • 20 Channels |
The customer creates 5 staff logins and connects 2 WhatsApp numbers. All features work immediately. | The system creates a dedicated VIP private contract with 5 seats and 2 phone lines, completely isolated from standard public plans. |
| Month 2 (Scenario 1: Simple Renewal) |
Same VIP Package
₹8,500 Renewal Invoice 5 Seats • 2 WA Lines • 20 Channels |
100% Zero Interruption: All 5 staff keep chatting, both WhatsApp lines stay live, and scheduled campaigns run smoothly. | The system simply advances the customer's 30-day service clock by +30 days. No settings are touched. |
| Month 2 (Scenario 2: Quota Upgrade) |
Upgraded VIP Scale
₹14,500 / month 10 Seats • 5 WA Lines • 50 Channels |
The manager opens their team portal and sees "4 of 10 Seats Used". They can immediately click "+ Add Agent" to invite Staff 5, 6, 7, 8, 9, 10! | The system automatically updates the customer's private contract limits: bumps agent limit from 5 to 10 and WhatsApp lines from 2 to 5. |
| Month 2 (Scenario 3: Downgrade to Pro) |
Standard Pro Package
₹1,499 / month 1 Seat • 1 WA Line • 3 Channels |
The primary manager stays active. Extra staff logins are safely paused (past chat transcripts and tickets remain fully preserved). | The customer's subscription switches from their custom contract to the standard off-the-shelf Pro package. |
View Technical Database Records (For Developers & DBAs Only)
| Lifecycle Stage | tbl_plans Record |
tbl_user_subscriptions |
|---|---|---|
| Month 1 (Initial Purchase) | status: 'custom_private', included_agent_seats: 5, included_whatsapp_numbers: 2 |
plan_id: [Dedicated Plan ID], end_date: '2026-12-03' |
| Month 2 (Scenario 1 Renewal) | Unchanged | end_date: '2027-01-03' (+30 days) |
| Month 2 (Scenario 2 Upgrade) | included_agent_seats: 10, included_whatsapp_numbers: 5, price: 14500.00 |
end_date: '2027-01-03' |
| Month 2 (Scenario 3 Downgrade) | Private plan archived; linked to standard Pro plan row | plan_id: [Pro Plan ID], end_date: '2027-01-03' |
8. Final Summary & Master Implementation Roadmap
Comprehensive readiness checklist: What is already completed, what is pending, and the exact steps to implement once approved.
All 8 Features Ready
Module access permissions (WhatsApp Business, WhatsApp Web, AI Telecalling, Helpdesk, Social Publishing, CRM, AI Content Studio, Lead Gen Builders, White-Label) are completely functional and unlock automatically upon payment.
Private Plan Isolation
By applying the 3-step Private Custom Plan implementation, custom subscribers get their exact purchased seats, channels, and WhatsApp lines without ever touching standard public plans.
3-Tier Team & Security
Clarifies the ₹499 Helpdesk Add-on, Growth Plan 3-seat bundle, and Custom multi-line teams. Implements dynamic modal checkboxes and server-side PHP tab protection so staff never see API keys or billing.
Seamless Renewals
In Month 2, clients renew with 1 click or request quota upgrades (e.g. 5 → 10 seats). In-place updates expand limits instantly without disconnecting numbers or losing team configurations.
8.1 Automated Credentials Email Dispatch: Support Agent vs. Team Member
Codebase Inspection Finding: You asked whether Team Members receive an automated welcome email with credentials and login URL like Support Agents do. Here is what we found inside the code:
TicketService.php:944-1008- ✅ Generates secure temporary password.
- ✅ Sends Welcome Email to the new agent containing their Email, Password, Assigned Role, and Login URL (
/agent/login). - ✅ CC's the Account Owner and Super Admin so everyone has a record.
- ✅ Sends confirmation receipt to owner inbox.
Front.php:18936-19045 (addTeamMember)- ✅ Checks seat limit & hashes password.
- ✅ Saves row in
admindatabase table. - ❌ DOES NOT SEND ANY EMAIL! There is zero email sending code in
addTeamMember. - ⚠️ The boss currently has to manually message the employee their password and login URL!
In Front::addTeamMember, wire in EmailService::sendTemplateEmail (identical to TicketService.php:977). When the boss clicks "+ Create Member", the employee will automatically receive an official welcome email containing: Their Name, Workspace Name (Acme Corp), Login URL (/agent/login), Email, Temporary Password, and Assigned Roles, with a direct CC to the boss!
8.2 Master Implementation Status Checklist
A transparent status report showing what is already complete and verified vs. what will be deployed once your head gives approval:
| Component / Feature | Current Status | What Works Today | What Will Be Implemented (Pending Approval) |
|---|---|---|---|
| 1. All 8 Custom Features | Completed | Controllers and permission toggles for WhatsApp, CRM, AI Calling, Social, etc., unlock correctly upon payment. | None required — already functional. |
| 2. Support Ticket Seat Calculator | Completed | Calculates ₹499/seat, purchases add-on, stores in user_addons, dispatches welcome credentials email + owner CC. |
None required — fully verified. |
| 3. Private Custom Plan Isolation | Ready for Deploy | Quote requests stored in tbl_custom_plan_requests and checkout URLs generated. |
Apply 3-step isolated plan activation (status = 'custom_private') so custom limits don't touch standard plans. |
| 4. Team Member Permission Checkboxes | Pending Approval | Modal in team/index.php only has 3 dummy dropdowns submitting value="market-team". |
Replace dropdown with Department Presets + Granular Module Checkboxes (WhatsApp, CRM, Tickets, Calling, Social). |
| 5. Team Member Credentials Email | Pending Approval | Zero emails dispatched when team members are created. | Add automated welcome email with credentials & login URL in Front::addTeamMember (mirroring TicketService). |
| 6. 100% Secure Tab Protection | Pending Approval | In whatsapp_business/index.php, Meta API credentials and Billing tabs are in view file without role checks. |
Wrap sensitive tabs in <?php if (empty($isStaffAgent)): ?> so server physically never sends API keys to staff. |
| 7. Multi-Line WhatsApp Routing | Pending Approval | Webhook routes all messages to primary user account. | Route incoming messages by phone_number_id to either Sales Desk (Line 1) or Support Desk (Line 2). |
| 8. Bulk Email Marketing Platform | Ready for Deploy | Transactional system emails work via PHPMailer / standard SMTP. | Implement dual-subdomain Amazon SES engine, automated 4-week warm-up, RFC 8058 1-click unsubscribe, DPDP consent vault, and plan-wise quotas (Standard = Add-on, Growth = 10k/mo bundled, Custom = 50k-250k+). |
| 9. Master Admin Credentials Hub | Completed & Verified | Centralized in /admin/omnichannel & /admin/whatsapp-business. Stored as encrypted JSON in channel_providers. |
None required — Amazon SES, Fast2SMS DLT, Sarv Voice OBD, and Meta WhatsApp Cloud API credentials are fully integrated with zero client-side key leakage. |
| 10. Tenant Inspection Hub & Debugger | Completed & Verified | Live Tenant Credits table with real-time remaining/consumed counts, 1-click Block/Allow toggle, and 1-click Adjust balance modal. | None required — Added 1-click [Logs] modal querying /admin/omnichannel/userLedger/:id showing provider refs and exact error messages (DLT mismatch, SES rejection, etc.). |
| 11. Automated Notifications & Activity Logging | Completed & Verified | Automated low-credit alert (< 100 units), abuse circuit breaker auto-pause (> 5% bounces or > 0.3% complaints) with emergency alerts to admin & tenant, and immutable logging in channel_usage_ledgers. |
None required — Fully wired via notifyAndLogActivity(...) and logUserActivity(...). |
| 12. Smart Rich Image SMS Engine | Ready for Deploy | Standard plain text SMS broadcasts work via Fast2SMS / generic SMS gateway. | Implement media upload zone, dynamic auto-shortener (/s/{code}), mobile landing card preview, interactive WhatsApp/Call CTAs, and DLT variable substitution ({#var1#}) with per-contact click tracking. |
| 13. Feature Maintenance Shield (Option 2) | Completed & Verified | Automatic microservice offline detector (`WhatsAppWebService::checkHealth()`), centralized controller gate (`checkMaintenanceShield()`), branded front screen (`front/feature_under_maintenance`), dynamic sidebar pill (`[Under Process]`), and Master Admin toggle button at /admin/whatsapp-web. |
None required — Fully implemented and active. Prevents live server crashes from missing Python FastAPI environment while preserving 100% of CRM, WhatsApp Meta, Telecalling, SMS, and Email. |
| 14. Lead Gen & Builder Tools Suite | 100% Working (Native) | Visual Page Builder (/landing-pages), Automation Forms (/forms), Captured Leads (/landing-pages/leads), Sales CRM Pipeline (/crm/pipeline), Classifieds Extractor (/classified-extractor), and Dynamic QR Codes (/qrcodes) run 100% on native PHP/MySQL. |
None required — Completely independent of Python. Standard plan gives 3 pages / 5 forms / 1 pipeline; Growth plan gives 25 pages / 50 forms / 5 pipelines; Custom plan offers unlimited quotas. |
8.3 Immediate Execution Roadmap (Once Approved)
Once your head approves the proposal, here is the clean, rapid engineering sequence to implement all remaining changes:
Add allowed_modules (JSON) and department columns to support_team_members and admin tables.
Update app/Views/front/team/index.php to render Role Presets and the 5 Module Checkboxes.
Wire EmailService into Front::addTeamMember to email login credentials to staff with CC to owner.
Wrap tab-connect & tab-billing in whatsapp_business/index.php with <?php if (empty($isStaffAgent)): ?>.
Conditionally render left navigation menu items based on $allowedModules from session.
Activate dedicated plan rows in tbl_plans for Custom Plan subscribers upon payment confirmation.
Submit pre-written AWS support ticket (Section 9.7) for 50k emails/day and configure DNS DKIM/SPF/DMARC records.
Enter live production keys for Amazon SES, Fast2SMS, Sarv OBD, and Meta WhatsApp in /admin/omnichannel.
Add media uploader to omnichannel/sms/index.php, create shortener route /s/(:any), and deploy mobile landing card view.
9. Bulk Email Platform Architecture, Multi-Tenant Engine & 3-Plan Integration
Comprehensive technical blueprint, Amazon SES deliverability architecture, automated 4-week warm-up scheduler, abuse circuit breakers, DPDP Act 2023 compliance, and commercial models across Standard, Professional Growth, and Custom Plans.
9.1 How Bulk Email Operates Across All 3 Plan Types
Bulk email involves strict global ISP sender reputation rules (Google & Yahoo postmaster mandates). The table below outlines how bulk email is provisioned, billed, restricted, and delegated to staff agents across Standard, Professional Growth, and Custom Plans:
| Dimension | Standard Plans (Starter / Free) | Professional Growth Plan (₹4,999/mo) | Custom Enterprise Plan (₹8,500+/mo) |
|---|---|---|---|
| Commercial Model | Paid Add-On Only (0 free bulk emails included) |
Included Free Monthly Allowance (Bundled with core subscription) |
High-Capacity Bundled Engine (Tailored enterprise quota) |
| Monthly Email Quota |
0 Emails Included Users purchase Prepaid Bulk Email Credit Packs via Omnichannel Wallet: • ₹499 for 10,000 Email Credits • ₹1,999 for 50,000 Email Credits • Or Pay-As-You-Go at ₹0.05/email. |
10,000 Marketing Emails / month included at ₹0 extra cost. Overage: If monthly volume exceeds 10,000, excess emails cost ₹0.05/email deducted automatically from Omnichannel Wallet balance. |
50,000 to 1,000,000+ Emails / month as configured in Custom Quote: • 50k: ₹2,000/mo allowance • 250k: ₹7,500/mo allowance • 1M+: Enterprise negotiated rate with dedicated billing account. |
| Anti-Spam & Reputation Safeguards |
Strict Sandbox Tier: • Daily limit: 200–500 emails/day during initial 14 days. • Must verify sending address via 6-digit OTP. • Prevents throwaway accounts from abusing our shared IP pool. |
Automated 4-Week Warm-Up: • Day 1-7: 200/day • Day 8-14: 1,000/day • Day 15-21: 5,000/day • Day 22+: 20,000+/day • Auto-pause if complaint rate reaches 0.3%. |
Enterprise Isolation: • Dedicated sending subdomain ( news.clientbrand.com).• Optional Dedicated IP Pool (clean IP solely for this client, zero contamination from other senders). • Rate limits up to 100 emails/second. |
| Domain Authentication | Shared Sender Pool (notifications@ctrltasq.com) or Bring-Your-Own custom verified single email address. |
Domain Authentication Wizard: Easy 1-click generation of 3 DKIM CNAMEs, SPF include:amazonses.com, and DMARC p=reject. |
Full White-Label Subdomain: Custom Return-Path (bounces.news.clientbrand.com), DKIM 2048-bit keys, DMARC reporting endpoint, and custom SSL tracking links. |
| Team Members & Agent Delegation |
0 Team Seats (Solo User) Only primary account owner can create lists and dispatch campaigns. |
3 Team Seats Included Owner can delegate to staff (e.g. Marketing Executive Rahul) via checkbox: [✓] Email Marketing & Newsletters.
|
5, 10, 25+ Team Seats Multi-agent marketing department with optional Two-Step Approval Workflow (Agent drafts campaign → Director approves broadcast). |
| Agent Security & Tab Protection | N/A (Solo owner). |
100% Zero-Trust Isolation: Staff agents can design templates, upload CSVs, and send campaigns, but CANNOT see AWS SES keys, SMTP credentials, Omnichannel wallet balance, or billing invoices. |
Departmental Role Separation: Marketing agents only see Campaign Builder and Analytics. Finance staff only see Billing. System administrators manage SMTP/DNS settings. |
9.2 Staff Agent Delegation: How Rahul Operates Without Seeing Billing or API Keys
In the Professional Growth and Custom Plans, the business owner can assign an employee (e.g. Marketing Specialist Rahul Sharma) to manage bulk email campaigns. Here is the exact workflow and the server-side security isolating him from sensitive business tabs:
Owner opens /team modal, enters Rahul's details, and checks:
[✓] Email Marketing & Newsletters
[ ] Billing & Invoices (Unchecked)
[ ] Master API Credentials (Unchecked)
System dispatches welcome credentials to rahul@company.com with auto-generated secure password, direct portal login link (/login), and CC to account owner for audit trail.
When Rahul logs in, the PHP view engine wraps sensitive settings tabs in <?php if (empty($isStaffAgent)): ?>. The server physically never sends AWS SES keys or billing forms to Rahul's browser.
What the Staff Agent CAN Do:
- Create, edit, and duplicate email campaigns.
- Use the Drag-and-Drop Responsive HTML Newsletter Builder.
- Import subscriber lists (CSV/Excel) and manage contact segments.
- Preview emails across desktop and mobile screens.
- Schedule broadcasts or click "Send Now" (subject to quota availability).
- View delivery analytics: Opens, Clicks, Bounces, and Unsubscribes.
What the Staff Agent CANNOT Do (Protected):
- Cannot view company payment methods, credit cards, or invoices.
- Cannot view or top up the Omnichannel Wallet balance.
- Cannot view or edit AWS SES API credentials or SMTP passwords.
- Cannot modify core DNS authentication records (SPF, DKIM, DMARC).
- Cannot export raw suppression list (contains sensitive opt-out data).
- Cannot bypass daily warm-up sending speed limits.
9.3 The Dual-Subdomain Deliverability Architecture
To ensure critical system emails (OTPs, password resets, payment invoices, ticket alerts) never land in the Spam folder due to marketing campaign spikes, Ctrl TASQ enforces a strict Dual-Subdomain Separation:
Subdomain 1: mail.ctrltasq.com
Reserved strictly for single-recipient, mission-critical messages:
- User sign-up OTPs & Password reset verification links
- Razorpay / Stripe payment confirmation receipts & PDF invoices
- Support ticket created & agent reply notifications
- Team member welcome credentials with auto-generated passwords
Subdomain 2: news.ctrltasq.com / Custom Domain
Dedicated to bulk broadcast campaigns, drip sequences & promotional newsletters:
- Standard Plan: Shared pool on
news.ctrltasq.com - Growth & Custom Plans: Customer's own authenticated subdomain (e.g.
news.customerbrand.com) - Custom Return-Path:
bounces.news.ctrltasq.com(MX handling) - Mandatory 1-click unsubscribe headers in compliance with RFC 8058
mail.ctrltasq.com) remains 100% unaffected.
Required DNS Authentication Records for Customer Domains:
| Type | Host / Name | Target / Value | Purpose |
|---|---|---|---|
| TXT | news.customerdomain.com |
v=spf1 include:amazonses.com ~all |
SPF Authorisation |
| CNAME (x3) | [token]._domainkey.news... |
[token].dkim.amazonses.com |
DKIM 2048-bit Cryptographic Signing |
| TXT | _dmarc.news.customerdomain.com |
v=DMARC1; p=reject; pct=100; rua=mailto:dmarc-reports@ctrltasq.com |
DMARC Policy (Strict Rejection of Spoofing) |
| MX | bounces.news.customerdomain.com |
10 feedback-smtp.us-east-1.amazonses.com |
Custom Return-Path (SPF Alignment) |
9.4 Automated 4-Week Domain Warm-Up & Abuse Circuit Breakers
Internet Service Providers (Gmail, Yahoo, Microsoft) immediately throttle or block new domains that blast high volumes without a ramp-up history. Ctrl TASQ implements an automated warm-up scheduler combined with a real-time abuse circuit breaker:
200
Target most active subscribers with high open engagement.
1,000
Expand to recent customers with verified opt-in records.
5,000
Send full segment announcements; monitor spam rate.
20,000+
Full production capacity unlocked with solid sender reputation.
Real-Time Abuse Circuit Breaker (Auto-Pause Mechanism)
Ctrl TASQ connects directly to Amazon SES Event Destinations via real-time SNS webhooks. If any campaign breaches international deliverability safety thresholds, our automated circuit breaker trips immediately:
If more than 5 in 100 emails bounce, the queue stops instantly. Invalid addresses are added to the global suppression list to prevent permanent domain suspension.
Google Postmaster enforces maximum 0.3% complaints. If breached, Ctrl TASQ halts the campaign, notifies the admin, and freezes outgoing broadcasts for safety.
9.5 Legal Compliance: DPDP Act 2023 & RFC 8058 One-Click Unsubscribe
Ctrl TASQ ensures 100% compliance with India's Digital Personal Data Protection (DPDP) Act 2023 and the 2024 Google/Yahoo Bulk Sender Requirements:
1. DPDP 2023 Opt-In Consent Vault
Every contact imported into Ctrl TASQ must be tied to a verifiable digital consent record:
- Timestamp: Exact UTC datetime when consent was recorded.
- Source IP Address: User IP at the time of form submission.
- Opt-In Method: Web form, WhatsApp opt-in, or verified order checkout.
- Consent Text Version: Exact legal notice shown to the subscriber.
2. RFC 8058 1-Click Unsubscribe
Every outgoing marketing email automatically injects mandatory RFC 8058 HTTP POST unsubscribe headers:
List-Unsubscribe: <https://ctrltasq.com/unsubscribe/token> List-Unsubscribe-Post: List-Unsubscribe=One-Click
Enables Gmail and Yahoo users to unsubscribe directly from the email header with 1 click without entering a password. Processed within < 2 seconds.
Technical Blueprint
9.6 CodeIgniter 4 Implementation Blueprint
Developer / Architecture Only
Schema & Workers
The architecture integrates cleanly into our existing CodeIgniter 4 MVC codebase with zero third-party framework lock-in:
Database Schema Additions:
tbl_email_campaigns: (id, user_id, title, subject, html_content, status, scheduled_at, total_recipients, sent_count, bounce_count, complaint_count)tbl_email_campaign_queue: (id, campaign_id, recipient_email, status [pending/sent/failed], attempts, sent_at)tbl_email_suppression_list: (id, email, reason [hard_bounce/complaint/unsubscribe], created_at)tbl_email_domains: (id, user_id, domain_name, dkim_verified, spf_verified, dmarc_verified, status)
Background Queue Worker (Spark CLI):
A high-throughput queue processor runs every minute via Linux cron:
Pulls pending batches, checks against tbl_email_suppression_list, throttles at 50/sec rate limit, and logs delivery metrics.
Amazon SES Real-Time Webhook Controller:
Controller endpoint app/Controllers/Api/SesWebhookController.php receives SNS event notifications:
public function handleFeedback() {
$payload = json_decode($this->request->getBody(), true);
if ($payload['Type'] === 'SubscriptionConfirmation') {
file_get_contents($payload['SubscribeURL']); // Confirm SNS topic
return $this->response->setJSON(['status' => 'confirmed']);
}
$message = json_decode($payload['Message'], true);
if ($message['eventType'] === 'Bounce' && $message['bounce']['bounceType'] === 'Permanent') {
foreach ($message['bounce']['bouncedRecipients'] as $recipient) {
$this->suppressionModel->insert(['email' => $recipient['emailAddress'], 'reason' => 'hard_bounce']);
}
} elseif ($message['eventType'] === 'Complaint') {
foreach ($message['complaint']['complainedRecipients'] as $recipient) {
$this->suppressionModel->insert(['email' => $recipient['emailAddress'], 'reason' => 'complaint']);
}
}
return $this->response->setJSON(['status' => 'processed']);
}
9.7 Ready-to-Use Operational Drafts for Fast Launch
Below are pre-written, compliance-tested drafts ready to copy and paste for AWS approval and website signup forms (Click either dropdown to open and view text):
AWS Template
Draft 1: Amazon SES Multi-Customer Production Limit Request
View Application Draft
Legal Compliance
Draft 2: DPDP Act 2023 Compliant Opt-In Checkbox Text
View Legal Text
Embed this explicit consent statement next to email input forms and checkout pages:
tbl_optin_consent_vault.
10. Super Admin Operations: Gateway Credentials, Tenant Inspection & Activity Logging
Complete administrative governance manual: Where and how Admin configures Bulk Email, SMS, Voice, and WhatsApp credentials, how frontend tenants access them securely with zero key leakage, and how Admin monitors, inspects, and troubleshoots tenant issues in real time.
10.1 Where & How Admin Configures Gateway Credentials
All master omnichannel communication credentials are centralized under the Super Admin Hub at /admin/omnichannel. Below is the exact location and configuration protocol for each communication channel:
1. Bulk Email Engine (Amazon SES)
Admin: /admin/omnichannelAdmin navigates to Global Channel Provider Gateways → Clicks Config on Amazon SES Bulk Email Engine.
• AWS Secret Key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
• AWS Region: ap-south-1 (Mumbai) / us-east-1 (N. Virginia)
• Default From Email: news@ctrltasq.com
• Default From Name: Ctrl TASQ Updates
• Auth Type: AWS_SIGV4 (or SMTP Relay)
channel_providers.credentials_enc_json. Used automatically for all tenant email campaigns.
2. Bulk SMS Gateway (DLT Compliant)
Admin: /admin/omnichannelAdmin navigates to Global Channel Provider Gateways → Clicks Config on Generic DLT SMS Gateway.
• Auth Type: API_KEY (Header Authorization)
• API Key: [Fast2SMS / Provider Secret Key]
• DLT Sender ID / Header: CTRLTSQ
• DLT Principal Entity ID: 120115987654321
credentials_enc_json and dlt_config_json. Enforces TRAI DLT compliance on all outgoing Indian SMS.
3. Bulk Voice OBD Broadcast Gateway
Admin: /admin/omnichannelAdmin navigates to Global Channel Provider Gateways → Clicks Config on Bulk Voice OBD Gateway.
• Auth Type: BEARER_TOKEN
• Auth Token: [Sarv / Voice Gateway Token]
• Caller ID / Virtual Number: +919876543210
• Max Parallel Channels: 30 Simultaneous Calls
4. Meta Official WhatsApp Cloud API
Admin: /admin/whatsapp-business
Admin navigates to /admin/whatsapp-business → Master Credentials tab or /admin/omnichannel.
• Phone Number ID: 108349285718293
• WABA ID (Business Account): 102938475610293
• System User Access Token: EAAK... (Never-expiring)
• Webhook Verify Token: ctrltasq_webhook_secret_2026
10.2 The Seamless Frontend Handshake: Zero Key Exposure
When an end-user or staff agent (e.g. Rahul Sharma) dispatches a campaign, the frontend communicates with the backend seamlessly without exposing any underlying admin credentials:
Controller calls CreditManagerService::checkBalance($userId, 'EMAIL', $recipients). If insufficient, user is prompted to top up.
Backend executes ChannelProviderModel::getDefaultProvider('EMAIL') to load active gateway credentials securely from DB.
Message is dispatched or queued in tbl_email_campaign_queue. Zero API keys are ever sent to client JavaScript or browser.
CreditManagerService::deductCredit(...) updates remaining balances and writes an immutable audit record to channel_usage_ledgers.
10.3 Tenant Inspection Hub: Real-Time Debugging & Troubleshooting
If a user reports that emails or SMS campaigns are not delivering, or if an account needs urgent moderation, Admin has full real-time inspection controls:
1. 1-Click "Logs" Modal
Admin clicks Logs next to any tenant on /admin/omnichannel. The system queries /admin/omnichannel/userLedger/:id and instantly displays the user's last 100 transactions, provider reference IDs, and raw provider error notes.
2. 1-Click Instant "Block" Switch
If a user sends unsolicited spam or violates acceptable use, Admin clicks Block. The user's status flips to DISALLOWED, immediately preventing them from initiating any broadcasts across all channels.
3. 1-Click Credit Adjustment / Refund
If a campaign failed due to an external gateway outage, Admin clicks Adjust → enters credits to refund with an audit reason → credits are restored instantly with a timestamped record.
Common Tenant Issues & How Admin Diagnoses Them:
| User Symptom | Inspection Finding in Admin Logs | Admin One-Click Resolution |
|---|---|---|
| "My SMS campaign failed to send." | Status shows FAILED with metadata: Error: DLT Template mismatch / Template ID unverified. |
Instruct user to ensure their SMS text matches the exact approved DLT template approved on the government portal. |
| "Bulk emails are auto-paused." | Status shows BOUNCED with bounce rate > 5.0% or complaint rate > 0.3%. Circuit breaker tripped. |
Inspect recipient list quality. Click Adjust to refund unaffected credits, and require customer to clean invalid email addresses. |
| "Insufficient credits popup appearing." | Tenant credits table shows 0 credits remaining for that channel. |
Admin clicks Topup to allocate prepaid bonus credits, or approves their pending payment request under Recent Topup Requests. |
10.4 Automated Notification Triggers & Activity Logs
The platform implements automated background triggers that notify stakeholders and keep an immutable audit log:
Automated System Notifications & Emails:
- Low Credit Alert (< 100 units): Dispatches automated email and dashboard alert to user: "Your Bulk Email credits are running low (64 remaining). Top up now to prevent scheduled campaigns from pausing."
- Abuse Circuit Breaker Alert: When a campaign trips the 5% bounce or 0.3% complaint threshold, an emergency notification is dispatched to both user and Super Admin (
admin@ctrltasq.com). - Top-Up Approval Notification: When Admin approves an offline recharge or PO,
notifyAndLogActivity(...)immediately notifies the customer with payment confirmation and credited units. - Staff Agent Welcome Email: When an owner creates an agent (e.g. Rahul Sharma), the system sends automated welcome credentials and direct login URL with owner CC.
Immutable Activity Logs (Compliance Audit Trail):
- Gateway Config Changes: Whenever Admin updates an API key, endpoint URL, or DLT ID,
logUserActivity(...)writes an entry to the system activity log. - Credit Allocations & Adjustments: Every manual credit topup, balance set, or refund is written to
channel_usage_ledgerswith statusREFUNDEDorDEBITEDand admin note. - User Permission Overrides: When Admin blocks or allows a tenant's omnichannel access, an activity log entry is recorded with timestamp and admin identifier.
- Tenant Broadcast Records: Every outgoing message log records provider message ID, recipient count, credits consumed, and delivery timestamp.
10.5 Implementation Reminder & Codebase Reference for Deployment
For seamless deployment and future maintenance, here is the complete file and architecture reference for all Super Admin governance modules:
app/Controllers/AdminOmnichannel.php(Provider configuration, AWS/SMTP JSON storage, email credit allocation,userLedger()endpoint)app/Views/admin/omnichannel/index.php(Bulk Email KPI card, Tenant Credits column, AWS/DLT Config modal,[Logs]inspection modal)app/Config/Routes.php(Route:admin/omnichannel/userLedger/(:num))app/Services/Omnichannel/CreditManagerService.php(Multi-channel balance checking, auto-debits, refunds)app/Models/Omnichannel/ChannelCreditModel.php(Addedemail_credits,allocated_email,consumed_email)
channel_providers: Stores API endpoints, AWS keys, secret tokens, regions, DLT entity IDs in encrypted JSON.channel_credits: Tracks real-time user balances and consumed quotas for SMS, Voice, WhatsApp, and Bulk Email.channel_pricing_plans: Governs platform cost, client price, reseller price, and credit multipliers.channel_usage_ledgers: Permanent immutable audit trail of every dispatch event, provider ref, and error note.
11. Smart Rich Image SMS Platform: Technical Blueprint, DLT Compliance & Mobile Web Cards
Comprehensive architecture for sending promotional images, banners, and rich media through SMS in full compliance with Indian TRAI DLT regulations. Combines 160-character SMS with dynamic auto-shortened links, mobile landing cards, and real-time click tracking.
11.1 The Market Reality: Why Smart SMS Beats Deprecated Native MMS
Standard GSM SMS is strictly limited to 160 plain characters. In global markets, "Multimedia Messaging Service" (MMS) was used, but in India, telecom operators (Jio, Airtel, Vi) have largely discontinued native A2P MMS due to cellular data costs and TRAI DLT restrictions.
Standard Text Only
- 160 characters (GSM-7) / 70 chars Unicode.
- Zero media or image support.
- Blind delivery (cannot track if user read it).
- Cost: ₹0.15–₹0.25 per credit.
Carrier Binary Push
- Carries JPEG/PNG up to 1.2 MB.
- Discontinued by Indian telcos (Jio/Airtel).
- High carrier failure rates across networks.
- Cost: 3x to 5x higher ($0.02 / ₹1.50+).
SMS + Auto-Shortened Rich Card
- DLT compliant text + dynamic short link (
/s/{code}). - Renders inline image preview on smartphones.
- Opens high-res mobile card with CTA buttons.
- Full click analytics (Who clicked, time, device).
- Cost: 1 standard SMS credit (₹0.20–₹0.25).
11.2 Unified Campaign Composer: One Feature, Two Modes
In Ctrl TASQ, Plain Text SMS and Rich Image SMS live inside the same single feature (/omnichannel/sms). Customers toggle between plain text and rich media effortlessly:
Mode A: Plain Text SMS
Used for transactional alerts, OTPs, booking confirmations, and brief service reminders:
Mode B: Smart Rich Image SMS
Used for marketing promotions, festival offers, product launches, and flyers:
ctrltasq.com/s/{code}.11.3 TRAI DLT Compliance & Dynamic Variable Insertion
India's Telecom Regulatory Authority of India (TRAI) strictly requires all commercial SMS to match an approved DLT template registered on portals like Vilpower, Jio DLT, or Airtel DLT. Here is how Ctrl TASQ guarantees 100% compliance:
Approved DLT Template Format:
The URL is passed inside approved variable {#var3#}. Because the domain (ctrltasq.com) is whitelisted in DLT headers, Indian telecom filters pass the message instantaneously without blocking.
Runtime Dynamic Replacement:
To enable individual click attribution, the system appends a cryptographic recipient token (e.g. ?r=919876543210) so the dashboard identifies exactly which customer opened the image!
11.4 Mobile Mini Landing Card Experience (/s/{code})
When the customer taps the link in their SMS app, Ctrl TASQ loads a lightning-fast (under 300ms), responsive mobile web card:
Exclusive festive pricing on all software, subscriptions, and electronics. Offer valid until Sunday midnight.
Key Features of the Mobile Landing Card:
- Zero App Download Required: Works inside any native smartphone browser (Chrome, Safari, Samsung Internet).
- High-Resolution Display: Full-width image display with pinch-to-zoom support for product menus and price sheets.
- 1-Click WhatsApp Ordering: Deep-links directly to the business WhatsApp number with pre-filled order text (e.g., "Hi, I want to order from your Diwali Sale offer!").
- 1-Click Direct Calling: Triggers
tel:+919876543210for instantaneous phone inquiries. - OpenGraph Meta Tags: Generates automated rich image preview thumbnails in modern Android Google Messages and Apple iOS iMessage.
11.5 Real-Time Click Attribution & CTR Analytics
Standard SMS provides zero reading metrics. Smart Rich Image SMS provides enterprise-grade performance tracking:
10,000
SMS Delivered2,480
24.8% CTR (Avg 3-5x higher)612
Chat inquiries initiated184
Direct phone dial clicks
Technical Blueprint
11.6 CodeIgniter 4 Technical Implementation Blueprint
Developer / Architecture Only
SQL & Controller
Clean, lightweight integration into our existing CodeIgniter 4 omnichannel architecture:
Database Tables Required:
CREATE TABLE `tbl_sms_short_links` (
`id` bigint unsigned AUTO_INCREMENT PRIMARY KEY,
`user_id` bigint unsigned NOT NULL,
`campaign_id` bigint unsigned DEFAULT NULL,
`short_code` varchar(12) NOT NULL UNIQUE,
`image_path` varchar(255) NOT NULL,
`title` varchar(200) NOT NULL,
`description` text DEFAULT NULL,
`cta_type` enum('WHATSAPP','CALL','URL') DEFAULT 'WHATSAPP',
`cta_value` varchar(255) NOT NULL,
`clicks_count` int unsigned DEFAULT 0,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP,
KEY `idx_code` (`short_code`)
);
CREATE TABLE `tbl_sms_clicks` (
`id` bigint unsigned AUTO_INCREMENT PRIMARY KEY,
`short_link_id` bigint unsigned NOT NULL,
`recipient_phone` varchar(20) DEFAULT NULL,
`ip_address` varchar(45) NOT NULL,
`user_agent` text DEFAULT NULL,
`clicked_at` datetime DEFAULT CURRENT_TIMESTAMP,
KEY `idx_link` (`short_link_id`)
);
Routing & Controller:
public function viewCard($shortCode) {
$card = $this->shortLinkModel->where('short_code', $shortCode)->first();
if (!$card) {
return redirect()->to(base_url())->with('error', 'Expired link.');
}
// Record click
$this->clickModel->insert([
'short_link_id' => $card['id'],
'recipient_phone' => $this->request->getGet('r'),
'ip_address' => $this->request->getIPAddress(),
'user_agent' => $this->request->getUserAgent()->getAgentString()
]);
$this->shortLinkModel->where('id', $card['id'])->increment('clicks_count');
return view('omnichannel/sms/landing_card', ['card' => $card]);
}
12. Master Admin Feature Maintenance Shield & Live Server Guard (Option 2)
Zero-disturbance strategy for handling features requiring uninstalled server packages (e.g., Python FastAPI) without crashing or touching working modules
Option 1: Hide Everywhere in Frontend
High Risk / FragileAttempting to conditionally hide a feature from the sidebar, pricing cards, pricing JS calculators, comparison grids, landing pages, headers, and footers:
- Requires Editing 25+ Files: Touching views across landing, pricing, calculators, footers, mobile drawers, and static pages.
- High Regression Risk: A tiny Blade/PHP typo or broken Javascript bracket can break pricing sliders or registration forms.
- Does NOT Prevent Server Crashes: If a user has a bookmark, direct link, or email URL (
/whatsapp-web), the request STILL reaches the controller. On a live server lacking Python, it attempts to bind sockets and crashes with an ugly 500 Server Error.
Option 2: Controller Maintenance Shield (Selected)
100% Safe & EffortlessCentralized controller interception gate with automated offline microservice detection:
- Zero Disturbance: Zero changes required to pricing matrices, calculators, homepage banners, or working CRM/Meta WhatsApp engines.
- 100% Crash Prevention: Intercepts on Line 1 of the controller. If Python is absent, it immediately stops execution and renders a beautiful, friendly "Under Process" page.
- Professional Customer Experience: Users see a scheduled cloud upgrade badge, an explanation that other active tools (CRM, Meta WhatsApp, Telecalling) are 100% operational, and a 1-click CTA to open Meta Official WhatsApp API.
- Dynamic Sidebar Badge: The sidebar menu item automatically switches from
[Web Engine]to[Under Process]in amber.
12.1 Real-Time Server Environment Guard Flow
How Ctrl TASQ automatically protects live production when Python FastAPI is offline:
1. User Clicks / Navigates
User visits /whatsapp-web or triggers an automation action.
2. Health & Maintenance Gate
is_feature_under_maintenance('whatsapp_web') checks DB flag and pings checkHealth() (3s timeout).
3. Intercept & Shield
Python offline? Request halted immediately before any socket or daemon code executes.
4. Branded UI & Alternative
Renders feature_under_maintenance.php with 1-click CTA to /whatsapp-business.
12.2 Master Admin Live Control & Multi-Feature Universal Shield
The Master Admin has full visibility and 1-click override power from the admin dashboard:
1-Click Admin Toggle:
At /admin/whatsapp-web, the Master Admin sees a dedicated Feature Maintenance Shield Card.
- Standby / Python Offline: Displays amber notice indicating microservice is offline and shield is automatically engaged.
- Manual Override: Admin can click
[Activate Shield]or[Deactivate Shield]at any time. - DB Key: Stored in
app_settingsundermaint_whatsapp_web.
Universal Multi-Feature Support:
The helper is_feature_under_maintenance($moduleKey) is designed generically for all features:
maint_classified_extractor: If newspaper OCR server binaries are being recompiled or upgraded.maint_landing_pages: If page template CDN is undergoing maintenance.maint_ai_telecalling: If voice telephony trunk provider is performing scheduled maintenance.
12.3 Lead Gen & Builder Tools Suite: Server Environment & Plan Matrix
Full audit of all 6 tools from the Lead Gen & Builder Tools sidebar section, confirming zero Python dependencies and native PHP execution:
| Sidebar Tool | Runtime / Dep | Live Status | Standard Plan | Professional Plan | Custom Plan |
|---|---|---|---|---|---|
| Visual Page Builder /landing-pages |
PHP + JS Canvas | 100% Operational | 3 Published Pages | 25 Published Pages | Unlimited Pages + Custom CNAME |
| Automation Forms /forms |
PHP + MySQL JSON | 100% Operational | 5 Active Forms | 50 Forms + Webhooks | Unlimited Multi-Step Forms |
| Captured Leads Hub /landing-pages/leads |
MySQL Relational DB | 100% Operational | 500 Stored Leads | Unlimited Leads + Auto-Tagging | Unlimited + Real-time Streaming |
| Sales CRM Pipeline /crm/pipeline |
PHP Kanban Engine | 100% Operational | 1 Default Pipeline (4 Stages) | 5 Pipelines + Automation | Unlimited Pipelines + Commissions |
| Classifieds OCR Extractor /classified-extractor |
PHP + Tesseract / Vision API | 100% Operational | 1 Batch / 10 Clips (Trial) | 50 Batches / 500 Clips/mo | Custom High-Volume (1k-10k+ Clips) |
| Generate QR Codes /qrcodes |
Endroid PHP Library | 100% Operational | 10 QR Codes | Unlimited Dynamic Trackable | Unlimited Vector SVG/EPS |