Dear all,

I am trying to implement an email invitation system.

# coding: utf8

def invitation():
      form = FORM(INPUT(_name='email', requires=IS_NOT_EMPTY()),
           INPUT(_type='submit'))
      if form.accepts(request.vars):
            uuid=str(uuid.uuid4())
            db.invitation.insert(token = uuid)
            mail.send(to=form.vars.email,message='click %s to
register' % URL('register',args=uuid))
            redirect(URL('index'))
      return dict(form=form)

I inspired myself from a code that I found on Stackoverflow but I am
new with Web2py. The code does not work. Can somebody help me ?

Thanks a lot,
Dwayne

P.S. : the indentation on Google Groups is a bit painful !

Reply via email to