Pulling record data into email template

Pulling record data into email template

  
We are building a system to log data, and at the end we want to send an automated email, to the customer whose item we have logged, displaying the information logged relating to their item.

I.e. We want a standard email template with fields that only show the information relating to the item just logged, and send this to the customer we have logged the item against.

How can we pass the customer ID and item ID, and then use these to pull the relevant record so we can then drop in the required fields into the email template?
Marcus -

You do it the exact same way you would do it on a screen. You give the email an input parameter for customer and item IDs, and in the email's Preparation you do the needed queries, and use the appropriate widgets to put them in the email.

J.Ja