A reminder based on each customer's pace
A fixed date ("after 45 days") does not work for everyone. Each customer has a usual interval between visits. The reminder goes out when they are taking one and a half times longer than normal.
const intervalo = mediana(diasEntreVisitas(cliente)) // 21 days
const sinVenir = diasDesde(cliente.ultimaVisita) // 34 days
if (sinVenir > intervalo * 1.5 && !cliente.avisadoEsteMes) {
actualizarPase(cliente, { mensaje: '2 more stamps until your dinner for two' })
}Recommendation. In Apple Wallet, changing a field that has changeMessage shows the notice on the lock screen. No separate email is needed.