Appearance
Order Reminder Emails
Flow ID: SY-14 | Module(s): job, eshop | Complexity: Low Last Updated: 2026-04-04
Business Overview
The order reminder job sends follow-up emails to customers with unpaid or pending orders, encouraging them to complete their purchase. This is a thin orchestration job in the platform core -- the actual reminder logic is entirely client-specific, implemented by overriding order_model->sendOrderReminder() in client repositories.
What the job does:
- Delegates entirely to
order_model->sendOrderReminder() - The base
Adv_order_modeldoes NOT implementsendOrderReminder()-- it is a hook point for client customization - Each client defines their own query criteria, email content, and reminder timing
Business value: Recovers abandoned orders by nudging customers to complete payment, with fully customizable business rules per client.
Architecture
AdvSendOrderReminderMail (JobCommand)
|
+--> order_model::sendOrderReminder() [client-defined method]
|
+--> query eligible orders [client criteria]
+--> adv_mailer::send() [client template]Job Classes
| Class | File | Purpose |
|---|---|---|
AdvSendOrderReminderMail | ecommercen/job/libraries/AdvSendOrderReminderMail.php | Base job -- thin delegate |
SendOrderReminderMail | application/modules/job/libraries/SendOrderReminderMail.php | Client-overridable subclass |
Dependencies
| Class | File | Role |
|---|---|---|
Adv_order_model | ecommercen/eshop/models/Adv_order_model.php | Base order model (no reminder method) |
Order_model | application/modules/eshop/models/Order_model.php | Client override point |
Adv_mailer | application/models/Adv_mailer.php | Email dispatch |
Code Flow
1. Job Initialization
The constructor loads order_model and adv_mailer:
constructor:
load eshop/order_model
load adv_mailer2. Execute Command
The entire executeCommand() is a single delegation:
php
$this->ci->order_model->sendOrderReminder();3. Client Implementation (Expected Pattern)
Client repos typically implement sendOrderReminder() in their Order_model override with logic such as:
- Query eligible orders: Select orders where
status = 'PENDING'andentry_datetimeis older than N days - Filter by payment method: Optionally restrict to specific payment methods (e.g., bank transfer orders waiting for payment)
- Send reminder email: Use
adv_mailer->send()with a custom template - Mark processed: Update a flag to prevent duplicate reminders
The specific criteria, timing, and email content vary entirely by client.
Data Model
Primary Table: shop_order
The reminder job works with the order table, but the specific columns used depend on the client implementation. Common columns involved:
| Column | Type | Role |
|---|---|---|
id | int | PK |
order_serial | varchar | Human-readable order number |
status | varchar | Order status (PENDING, PAID, etc.) |
entry_datetime | datetime | When the order was placed |
payway | varchar | Payment method identifier |
customer_id | int | FK to customer |
Configuration
Job Scheduling (application/config/jobs.php)
php
// ['command' => 'SendOrderReminderMail', 'schedule' => '0 19 * * *', 'graceTime' => 300, 'retryTimes' => 3],Commented out by default (client opt-in). Default schedule when enabled: daily at 19:00.
Job Options
The job defines no options (getOptions() returns an empty array). Client overrides may add their own.
Client Extension Points
Implement the reminder method (required): Override
Order_modelinapplication/modules/eshop/models/and implementsendOrderReminder(). This is the primary extension point -- the base platform provides no default implementation.Override the job class: Create
SendOrderReminderMailinapplication/modules/job/libraries/extendingAdvSendOrderReminderMail. OverrideexecuteCommand()to add pre/post processing or pass options.Custom email templates: Create client-specific reminder email templates in
application/views/.Multiple reminder schedules: Register multiple job entries with different options to support multi-stage reminder sequences (e.g., 24h, 48h, 7 days).
Business Rules
| Rule | Description |
|---|---|
| Client-specific | No default reminder logic exists in the platform; each client must implement sendOrderReminder() |
| Opt-in activation | Job is commented out by default in jobs.php; must be explicitly enabled per client |
| No built-in deduplication | Client implementations must manage their own sent-tracking to prevent duplicate reminders |
| Mailer pre-loaded | The adv_mailer model is loaded by the job constructor so client code can use it directly |
Related Flows
- SY-01 Cron Job Framework -- job scheduling and execution
- SY-24 Email Dispatch System --
Adv_mailer(pre-loaded by the job constructor) is the mechanism for dispatching order reminder emails - CF-07 Order Confirmation -- the initial order placement that creates PENDING orders
- CF-08 Payment Processing -- payment flows that resolve PENDING status