Fix issue in render_email in nereid

* Fixed issue in render_email.
* Added test for the same