The Lottery & Jackpot use case demonstrates how to display live, time-sensitive data from external sources directly in your campaigns. By connecting to a data source that contains dynamic information like jackpot amounts or event details, you can pull in the latest values using either a static key (e.g., a specific lottery ID) or a dynamic one (e.g., today's date). This is perfect for keeping your promotional content accurate and exciting without having to manually update your templates for every send.
Problem Statement
You want to show real-time lottery or jackpot data (like the current prize amount or draw date) in campaigns, but there’s no easy way to sync this dynamic, non-user-specific information into your messages.
Goal
You’re promoting a specific lottery (e.g., with ID DJ001) and need to show its live jackpot amount and draw time in your email, ensuring the information is always up to date.
Solution
You can display lottery-specific information by using the exact value from your dataset as the lookup key. Create a Data Connection keyed by a unique identifier (like a lottery ID or draw date). You can then use either a known, static value in your formula or a dynamic value like a Content Function (e.g., current date).
Implementation
Step 1: Create a Data Connection with the Right Primary Key
It is strongly recommended to use the API creation method to push the latest lottery or jackpot data into Optimove regularly. This ensures real-time accuracy and eliminates manual work.
Example Data (JSON format):
[
{
"date": "2025-04-07",
"currency": "USD",
"lottery_name": "Mega Millions",
"jackpot_amount": 1000000,
"daily_jackpot_id": "DJ001"
},
{
"date": "2025-04-07",
"currency": "EUR",
"lottery_name": "EuroJackpot",
"jackpot_amount": 750000,
"daily_jackpot_id": "DJ002"
}
]
Step 2: Use it in a Template with a Static Lookup
When you want to promote a specific, known lottery in a template, you can use its exact ID (e.g., DJ001) as a static key in the formula.
Demonstration:
Example Formulas:
Jackpot: [%DC_lotto789:DJ001::jackpot_amount:%]
Lottery Name: [%DC_lotto789:DJ001::lottery_name:%]
lotto789 with your actual Data Connection UUID.
Alternative Solution: Use Date as a Primary Key
If your draws are date-based and you want to show "today's lottery," you can use the draw date as the primary key. You can then use a dynamic Content Function, like [%CURRENT_DATE:yyyy-MM-dd%], as the lookup value.
Example Data Structure:
| draw_date | lottery_id | lottery_amount |
|---|---|---|
| 2025-07-30 | USLot1234 | $20 Million |
Example Setup and Formula:
Jackpot: [%DC_lotto789:[%CURRENT_DATE:yyyy-MM-dd%]::lottery_amount:%]
Outcome
This setup gives you the flexibility to:
- Display real-time information based on your external system.
- Use either static, known keys or dynamic, date-based keys as lookups.
- Avoid manual updates and hardcoded amounts by leveraging API synchronization.