Step 1: Store Users’ Time Zones
In each user’s profile (Operator record or a dedicated data type), store the time zone,
e.g.:
India: Asia/Kolkata
US (e.g., EST): America/New_York
Japan: Asia/Tokyo
Step 2: Create a Scheduled Queue Processor or Job Scheduler
This runs once an hour or more frequently (e.g., every 15 minutes).
In this Job Scheduler, do not send the email directly. Instead:
Step 3: Compare Local Time for Each User
For each user:
Get their time zone
Get current time in their zone
Check if it’s 07:00 AM (you can include a 5–10 min window to allow for scheduler lag)
Use the @ConvertTimeZone() function in PEGA to convert server time to user local time.
Example:
java
Copy
Edit @FormatDateTime(CurrentDateTime(), “yyyyMMddHHmm”, “GMT”, “Asia/Kolkata”)
Step 4: If Time Matches, Send Email
If the local time = 07:00 (within your tolerance window), send the notification email.
Keep track of last sent datetime to avoid duplicates.
Optional: Use a flag or timestamp in the DB to track “last email sent” per user.