Example #1
0
 def verify_email(self):
     email = self.request.params["email"]
     verification = EmailVerification(email)
     DBSession.add(verification)
     DBSession.flush()
     user = verification.email.user
     mailer = self.request.registry["mailer"]
     message = Message(
         recipients=[email],
         subject="%s email verification" % self.request.registry.settings["site_title"],
         body=render_template(
             "../templates/account/verify_email.txt", view=self, request=self.request, verification=verification
         ),
     )
     mailer.send(message)
     return dict(verification=verification)
 def _callFUT(self, name, **kw):
     from pyramid.chameleon_text import render_template
     return render_template(name, **kw)