something like:
db.define_table('invite',Field('email'),Field('uuid',default=str(uuid.uuid4())))
auth.settings.extra_fields['auth_user']=Field('uuid',requires=IS_IN_DB(db,db.invite.uuid)))
auth.settings.register_onaccept: lambda form:
db(db.invite.uuid==form.vars.uuid).delete()
auth.define_tables()
def invite:
form = SQLFORM(db.invite)
db.invite.uuid.default=str(uuid.uuid4())
if form.process().accepted:
auth.mailer.send(to=form.vars.email,
message = db.invite.uuid.default)
return dict(form=form)
On Dec 2, 2:20 pm, Constantine Vasil <[email protected]> wrote:
> I have a list of email addresses and want to send invitation emails for a
> group
> membership to them.
>
> When the user clicks on the link in the email the system would not know
> in advance if he is an existing user or a new user, also in the email list
> the user can be invited with one email address but chooses to use
> different one to register.
>
> What would be the best solution to make existing users to login and continue
> with invitation process and the new users to complete registration and
> continue
> invitation process as a logged in users.
>
> The issue I ran is if the user clicks on the link in the invitation email
> in the
> link there is an embedded code which the system matches in a database
> to determine for what the user was invited for. If the system presents
> the usual login/register page and he has a choice to click anywhere,
> the code embedded in the link will not be available to continue the
> invitation
> process.
>
> How to accomplish this?
>
> Thanks!