#NEWLINE# def verify_email_notification( user_db ) : #NEWLINE# #INDENT# if ( ( not ( config . CONFIG_DB . verify_email and user_db . email ) ) or user_db . verified ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# user_db . token = util . uuid ( ) #NEWLINE# user_db . put ( ) #NEWLINE# to = ( '%s <%s>' % ( user_db . name , user_db . email ) ) #NEWLINE# body = ( "Hello %(name)s,\n\nit seems someone (hopefully you) tried to verify your email with %(brand)s.\n\nIn case it was you, please verify it by following this link:\n\n%(link)s\n\nIf it wasn't you, we apologize. You can either ignore this email or reply to it\nso we can take a look.\n\nBest regards,\n%(brand)s\n" % { #NEWLINE# #INDENT# 'name' : user_db . name , #NEWLINE# 'link' : flask . url_for ( 'user_verify' , token = user_db . token , _external = True ) , #NEWLINE# 'brand' : config . CONFIG_DB . brand_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# flask . flash ( 'A verification link has been sent to your email address.' , category = 'success' ) #NEWLINE# send_mail_notification ( 'Verify your email.' , body , to )