Fixed various bugs with buildling email body
Fixed typo in footer code and handling of custom ->template values
WordPress repo hotfix