Displaying Specific Custom Object Records
Our team is working on sending personalized emails based on information stored in a custom object using travel itinerary information. Our problem, though, is that many leads in our database have multiple itineraries (i.e. multiple custom object records). We have set up some script tokens to display custom object information, but this will only display info from the most recent custom object record. How do we ensure the correct itinerary is displayed?
For example: If we are sending a pre-travel type email 7 days before a person's departure, and that person has 2 itineraries (A & B), but only Itinerary B's departure date is in 7 days, how can we ensure only Itinerary B's info is displayed instead of Itinerary A? In this example, we would want to display a "Departure Date" field and a "Booking Number" field.
I know we would need to utilize some velocity scripting, but any assistance here would be greatly appreciated!