def _send_email(cls):
"""
Check the email type and send the requested email using
the email plugin.
"""
if not hasattr(cherrypy.request, 'email_address'):
return
if not hasattr(cherrypy.request, 'email_type'):
return
cherrypy.request.user = User.get_by_email(cherrypy.request.email_address)
if 'mail' in cherrypy.request.user:
if cherrypy.request.email_type == 'password':
cherrypy.engine.publish('email-send-reset', cherrypy.request.user)
if cherrypy.request.email_type == 'username':
cherrypy.engine.publish('email-send-username', cherrypy.request.user)
评论列表
文章目录