It looks like it would work to me. You are getting the information from the database and not from the cart directly. So it would only work if the information was saved correctly in the database before the email was generated... maybe it is in the wrong order on the confirm page and the order details haven't been stored when the email is sent?
Also since it is in the database, it probably doesn't know which shipping rule was used and it only stores the shipping total in the database. If you want to include all of that then it might make sense to get the information from the cart instead of the database when you send the email. The advantage of the email you have from the database is that it could also be used to re-send the receipt at any time from the admin back end. That of course wouldn't work if the email was built directly from the cart.