template_data should not be required. You can simply use template->assign_vars() yourself.