Make url_for accessible in mail templates by including it in the application helper. Remove ADMIN_HOST_AND_PORT which duplicates ADMIN_PREFIX.