Best practice for urls in emails?

0 views
Skip to first unread message

Dramus

unread,
Oct 31, 2006, 8:49:42 PM10/31/06
to TurboGears
I am writing a turbogears app which sends emails to users when they are
accepted to join a moderated group. I want to enclose a link back to
the group in the e-mail. I am using turbomail to generate the e-mail
using a KID template, but when you use:

tg.url('/groupname')

The e-mail encodes the link only as the relative part of the e-mail.

I thought that what I needed was to set server.webpath =
'http://mysite.com' in the config, but that breaks lots of other stuff
but fixes the e-mail.

You end up with things like GET: /http://mysite.com/groupname Not Found

I was looking through the groups and found some refernces to a ticket
that was closed as won't fix that seemed to also deal with this.

So since that was closed as won't fix is there a best practice for
doing this kind of thing?

Chris Miles

unread,
Nov 1, 2006, 8:02:22 AM11/1/06
to turbo...@googlegroups.com, Chris Miles
Take a look at cherrypy.request.path for the full URL of the request.

Cheers
CM

Dramus

unread,
Nov 2, 2006, 9:28:38 PM11/2/06
to TurboGears
I think what you meant was cherrypy.request.base

you got me looking in the right direction though, Thanks

Reply all
Reply to author
Forward
0 new messages