[Zope] Help eMail this page to a friend
ender
kthangavelu@earthlink.net
Fri, 23 Feb 2001 09:38:28 -0800
On Friday 23 February 2001 09:45, Loren Stafford wrote:
> I'm trying to make a global method to implement the "eMail this page to a
> friend" function I've seen on many sites. (Surely someone has already done
> this for Zope, but I don't see How-To or email on the subject.) What I have
> so far is this:
> <dtml-with "PARENTS[-1]"><dtml-sendmail mailhost=MailHost>
> To: <dtml-var eMailThisPageTo>@morphics.com
> Reply-to: <dtml-var "AUTHENTICATED_USER.getUserName()">@morphics.com
> From: webserver
> Subject: <dtml-var URL1>
> <dtml-mime type="text/html" encode="7bit">
> <dtml-var "REQUEST.resolve_url(URL1)">
> </dtml-mime>
> </dtml-sendmail></dtml-with "PARENTS[-1]">
resolve_url returns an object reference. using it with a dtml-var will cause
a str(object) to be inserted which in the case of dtml-doc/methods is
quotedHTML.
assuming url refers to a callable object (ala dtml doc/method), you can
render it with a
<dtml-let obj="REQUEST.resolve_url(URL1)">
<dtml-var "obj(_.None,_)">
</dtml-let>
or you could go for a one-liner
<dtml-var "REQUEST.resolve_url(URL1)(_.None,_)">
hth
kapil