Changed the way the template elements were found. #{} caused it to throw "PWC6228: #{...} not allowed in a template text body. ". Now the template is referred to as T{}. This works.