CLI Commands for Magento 2 Extension
Command line tools for the Product Review Reminder extension. These commands are useful for manual operations, automation scripts, and troubleshooting.
Available Commands
| Command | Description |
|---|---|
reviewreminder:queue |
Build the email queue from qualifying orders |
reviewreminder:process |
Process and send pending emails |
reviewreminder:selftest |
Run diagnostic tests |
reviewreminder:queue
Scans for orders matching profile criteria and adds them to the email queue.
# Build queue for orders up to 30 days old
bin/magento reviewreminder:queue --offset=30
# Build queue for orders up to 60 days old
bin/magento reviewreminder:queue --offset=60
Options:
| Option | Required | Description |
|---|---|---|
--offset |
Yes | Maximum order age in days to include |
Output: Shows number of orders queued for review invitation email.
Use this when:
- Testing a new profile configuration
- Recovering from missed cron runs
- Building initial queue after installation
- Troubleshooting queue issues
reviewreminder:process
Processes the email queue and sends pending review invitation emails.
bin/magento reviewreminder:process
Options: None
Output: Shows number of orders processed and any errors encountered.
Use this when:
- Testing email delivery
- Sending emails immediately without waiting for cron
- Troubleshooting email issues
- Processing after manual queue build
reviewreminder:selftest
Runs diagnostic tests to verify the extension is configured correctly.
bin/magento reviewreminder:selftest
Options: None
Output: Displays test results for:
- Module enabled status
- Profile configuration
- Database table integrity
- Cron job configuration
- Email settings
Use this when:
- Initial setup verification
- Troubleshooting any issues
- After configuration changes
- Regular health checks
Examples
Initial Setup Testing
# Run selftest to verify configuration
bin/magento reviewreminder:selftest
# Build queue for recent orders (last 14 days)
bin/magento reviewreminder:queue --offset=14
# Process queue to send emails
bin/magento reviewreminder:process
Daily Manual Processing
# Build queue and process in one sequence
bin/magento reviewreminder:queue --offset=30 && bin/magento reviewreminder:process
Troubleshooting Workflow
# Step 1: Check system health
bin/magento reviewreminder:selftest
# Step 2: Build queue with verbose output
bin/magento reviewreminder:queue --offset=7 -v
# Step 3: Process with verbose output
bin/magento reviewreminder:process -v
Catching Up After Downtime
# Queue orders from the past 60 days
bin/magento reviewreminder:queue --offset=60
# Process all pending emails
bin/magento reviewreminder:process
Scheduling via System Cron
As an alternative to Magento's built-in automation, you can schedule via system cron:
# Build queue daily at 1 AM
0 1 * * * cd /var/www/magento && bin/magento reviewreminder:queue --offset=30
# Process queue every 30 minutes
*/30 * * * * cd /var/www/magento && bin/magento reviewreminder:process
Note: This is only needed if you prefer system cron over Magento's cron automation configured in the admin panel.
Verbose Output
Add -v flag for more detailed output:
bin/magento reviewreminder:queue --offset=30 -v
bin/magento reviewreminder:process -v
bin/magento reviewreminder:selftest -v
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error occurred (check output for details) |
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team