def generate_notification_email_unsubscribe_token(user_id36, user_email=None, user_password_hash=None):
 import hashlib
 import hmac
 if ((not user_email) or (not user_password_hash)):
  user = Account._byID36(user_id36, data=True)
  if (not user_email):
   user_email = user.email
  if (not user_password_hash):
   user_password_hash = user.password
 return hmac.new(g.secrets['email_notifications'], ((user_id36 + user_email) + user_password_hash), hashlib.sha256).hexdigest()

def generate_notification_email_unsubscribe_token ( user_id36 , user_email = None , user_password_hash = None ) : import hashlib import hmac if ( ( not user_email ) or ( not user_password_hash ) ) : user = Account . _byID36 ( user_id36 , data = True ) if ( not user_email ) : user_email = user . email if ( not user_password_hash ) : user_password_hash = user . password return hmac . new ( g . secrets [ 'email_notifications' ] , ( ( user_id36 + user_email ) + user_password_hash ) , hashlib . sha256 ) . hexdigest ( )
generate a token used for one-click unsubscribe links for notification emails .