You are correct, you should use the store order summary and store order details server behaviors. There should be one recorded stored for the order in the orders table and a record for each item in the cart in the order details table.
The cart id is used to determine if it is a new order or an update to an existing order. You will need to reset this value after you go through the checkout. This value is based on the php session id. You can regenerate this id to ensure that each order is recorded properly. The best place to do this would be on the thank you page that you send the user to after the email is sent.
On this page add in some code like this to the bottom of the page: