Fixed so that permalink handling now takes into account the site namespace.
Added email hook for the user entity.