Generating invite link

1,037 views
Skip to first unread message

Zeynel

unread,
Nov 17, 2010, 11:30:49 PM11/17/10
to Google App Engine
How do we generate invite link in this example:

http://code.google.com/appengine/docs/python/mail/sendingmail.html

message.body = """
I've invited you to Example.com!

To accept this invitation, click the following link,
or copy and paste the URL into your browser's address
bar:

%s
""" % generate_invite_link(to_addr)

Is "generate_invite_link()" a function that we need to supply? What is
it? Thanks.

Robert Kluin

unread,
Nov 18, 2010, 12:06:22 AM11/18/10
to google-a...@googlegroups.com
Hi Zeynel,
You will need to write your own generate_invite_link function. How
you will do that depends on your app, but presumably you will direct
users to some URL specific to that user and ask them to signup or
something.

Robert

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

Gaurav Vaish

unread,
Nov 18, 2010, 4:04:40 AM11/18/10
to Google App Engine
Hi Zeynel,

You may want to do something as below:

Entity:
Invitation {
Date invitationTime;
String email;
String code;
}


Sending Mail:
Content can be something like "You are invited to
http://mastergaurav.appspot.com/invite/code".

Handling:
Add a handler at "/invite/*"
Grab the path-info (HttpServletRequest::getPathInfo). Remove
leading "/". Remainder part is your code.
Search in DB using this code. Get the email/invitationTime to do
futher processing (your invitation has been expired or welcome).


Hope that helps.


--
Happy Hacking,
Gaurav Vaish
www.mastergaurav.com

On Nov 18, 10:06 am, Robert Kluin <robert.kl...@gmail.com> wrote:
> Hi Zeynel,
>   You will need to write your own generate_invite_link function.  How
> you will do that depends on your app, but presumably you will direct
> users to some URL specific to that user and ask them to signup or
> something.
>
> Robert
>
Reply all
Reply to author
Forward
0 new messages