Fix for incomplete checkout notifications in 3.8.14

* Use correct names to get gateway and shipping information from purchase log for substitution into emails
* Handle condition where cart data has been fetched into purchase log but cart contents are not yet loaded