Added support for encoding body template variables