Esempio n. 1
0
 def _create_email_exists_message(self, email, oidIdentifier):
     c = cherrypy.request.app.config
     env = cherrypy.request.app.jinjaEnv
     s = SessionHelper()
     u = UniqueRequest()
     
     value = u.create(
         sessionKey=cherrypy.session.id,
         requestKey='add_openid.existing_account',
         data='|'.join([str(UserAccount().id_from_email(email)), oidIdentifier]))
     s.push('add_openid.existing_account', value)
         
     # need to pass the session id in case they visit it using a different browser
     linkAddress = 'http://{0}/account/add/email?sessionKey={1}&request={2}'.format(
         make_netloc(),
         cherrypy.session.id,
         s.peek('add_openid.existing_account'))
     
     text = env.get_template('email/account/create/existing/verify.txt').render(
         siteName=c['appSettings']['siteName'],
         email=email,
         identityURL=oidIdentifier,
         linkAddress=linkAddress)
     
     msg = MIMEText(text)
     msg['Subject'] = '{0} - Confirm Add E-mail Address'.format(c['appSettings']['siteName'])
     msg['From'] = self._get_from_address()
     msg['To'] = email
     
     return msg
Esempio n. 2
0
 def get_site_root(cls):
     return "http://{0}/".format(make_netloc())