Introduction
All Lovi notification endpoints support scheduling for future delivery. This feature allows you to send notifications at optimal times considering recipient timezones and business hours.π Scheduling Parameters
Both WhatsApp and Voice notifications support the following scheduling parameters:Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datetime_sending | DateTime | No | Scheduled date/time in ISO 8601 format | "2024-12-25T10:30:00" |
timezone | String | No | Timezone for the scheduled time | "Europe/Madrid" |
datetime_sending is not provided, the notification is sent immediately.
π Datetime Format
Supported ISO 8601 Formats
Important Notes
- Future Date Required: The datetime must be in the future
- ISO 8601 Strict: Use standard ISO 8601 format
- Timezone Recommended: Always specify timezone for scheduled messages
- UTC Default: If timezone is omitted, UTC is used
π Supported Timezones
Common Business Timezones
| Region/Country | Timezone Code | Description |
|---|---|---|
| Spain | Europe/Madrid | Central European Time |
| Mexico | America/Mexico_City | Central Standard Time |
| Argentina | America/Argentina/Buenos_Aires | Argentina Time |
| Colombia | America/Bogota | Colombia Time |
| Chile | America/Santiago | Chile Standard Time |
| Peru | America/Lima | Peru Time |
| Ecuador | America/Guayaquil | Ecuador Time |
| Venezuela | America/Caracas | Venezuela Time |
| United States | America/New_York | Eastern Standard Time |
| United States | America/Chicago | Central Standard Time |
| United States | America/Denver | Mountain Standard Time |
| United States | America/Los_Angeles | Pacific Standard Time |
| UTC | UTC | Coordinated Universal |
European Timezones
| Country | Timezone Code | Description |
|---|---|---|
| United Kingdom | Europe/London | Greenwich Mean Time |
| France | Europe/Paris | Central European Time |
| Germany | Europe/Berlin | Central European Time |
| Italy | Europe/Rome | Central European Time |
| Netherlands | Europe/Amsterdam | Central European Time |
| Portugal | Europe/Lisbon | Western European Time |
π Examples
WhatsApp Scheduled Notification
Immediate sending (no scheduling):Voice Scheduled Notification
Flat Structure with Scheduling (unflatten=true)
βοΈ Validation Rules
Date Validation
- β Future dates only: Must be later than current time
- β Maximum advance: Up to 1 year in advance
- β Format strict: Must follow ISO 8601
- β Past dates: Will be rejected
- β Invalid format: Non-ISO dates rejected
Timezone Validation
- β Valid IANA codes: Use standard timezone database
- β Case sensitive: Exact format required
- β Abbreviations: Donβt use CET, EST, etc.
- β Invalid codes: Unknown timezones rejected
Examples of Valid/Invalid
β Valid:π Best Practices
Optimal Timing
WhatsApp Messages:- Business hours: 9:00 AM - 6:00 PM local time
- Avoid early/late: Not before 8:00 AM or after 9:00 PM
- Weekend consideration: Adjust for weekend preferences
- Holiday awareness: Check local holidays
- Business hours only: 9:00 AM - 5:00 PM local time
- Workdays preferred: Monday through Friday
- Lunch hours: Avoid 12:00 PM - 2:00 PM
- Cultural sensitivity: Respect local customs
Timezone Strategy
- Store user timezones: Save preferred timezone per contact
- Local time display: Show times in userβs local timezone
- Business hour logic: Calculate optimal sending times
- Daylight saving: IANA codes handle DST automatically
Scheduling Workflow
π Response Examples
Successful Scheduling
Immediate Sending
β οΈ Common Errors
Past Date Error
Invalid Timezone Error
Invalid Format Error
π οΈ Development Tips
Testing Scheduling
- Use near future: Test with times 5-10 minutes ahead
- Timezone testing: Test different timezone scenarios
- Edge cases: Test daylight saving transitions
- Error handling: Test with invalid dates/timezones
Production Considerations
- Buffer time: Add 2-3 minutes buffer for processing
- Monitoring: Monitor scheduled vs actual send times
- Retry logic: Handle temporary failures gracefully
- Logs: Log scheduling details for debugging
Timezone Resources
- IANA Database: Official timezone database
- Online converter: Use tools to verify timezone codes
- Documentation: Keep timezone reference for developers
