- Use render_email() to wrap HTML in proper email template - Add error handling and logging for URL generation - Add log statement before sending to aid debugging - Import render_email at module level