Appearance
Notification Commands
Console commands for managing push notifications and device tokens.
List Device Tokens
List registered device tokens for push notifications.
bash
php bin/console app:device-tokens:list [options]Options:
| Option | Description |
|---|---|
--user-id | Filter by user ID |
--email | Filter by user email |
--platform | Filter by platform (ios/android) |
Examples:
bash
# List all iOS device tokens
php bin/console app:device-tokens:list --platform=ios
# List tokens for specific user
php bin/console app:device-tokens:list --email=user@example.comSend Device Notification
Send push notifications to user devices.
bash
php bin/console app:device-tokens:notify [options]Options:
| Option | Description |
|---|---|
--user-id | User ID to notify |
--email | User email to notify |
--all | Notify all registered devices |
--platform | Limit to platform (ios/android) |
--title | Notification title (required) |
--body | Notification body (required) |
--extra | Optional extra data field value |
Examples:
bash
# Send to specific user
php bin/console app:device-tokens:notify --user-id=1 --title="Hello" --body="Test notification"
# Send to all Android devices
php bin/console app:device-tokens:notify --all --platform=android --title="Update" --body="New version available"Test Notification
Test push notification delivery to verify configuration.
bash
php bin/console app:notification:test --user=<identifier> [--platform=<platform>]Options:
| Option | Description |
|---|---|
--user, -u | User email or ID (required) |
--platform, -p | Specific platform (ios/android) |
Example:
bash
php bin/console app:notification:test --user=user@example.com --platform=iosTIP
Use this command to verify your APNs (iOS) and FCM (Android) configuration is working correctly.
Warranty Notification Commands
Dispatch Warranty Notifications
Queue warranty expiration notifications for asynchronous processing.
bash
php bin/console app:dispatch-warranty-notificationsThis command:
- Finds products with warranties expiring soon
- Creates notification jobs in the message queue
- Notifications are sent asynchronously by workers
Scheduling
This command should be run via cron job, typically daily:
bash
0 9 * * * cd /path/to/project && php bin/console app:dispatch-warranty-notificationsList Expiring Warranties
List products with warranties expiring within a specified window.
bash
php bin/console app:warranties:expiring [--days=<days>]Options:
| Option | Description |
|---|---|
--days | Days window from today (default: 30) |
Example:
bash
# List warranties expiring in next 60 days
php bin/console app:warranties:expiring --days=60List Notification Logs
View warranty notification logs to track what notifications were sent.
bash
php bin/console app:warranties:notifications:list [options]Options:
| Option | Description |
|---|---|
--product-id | Filter by product ID |
--days | Filter by threshold days |
--limit | Limit result count (default: 100) |
Example:
bash
php bin/console app:warranties:notifications:list --product-id=123Notification Thresholds
The system sends warranty expiration notifications at these thresholds:
- 30 days before expiration
- 7 days before expiration
- 1 day before expiration
Each product only receives one notification per threshold (tracked in notification logs).
