[Zope-CMF] How do I access email property?

Boddy Stephen Stephen.Boddy@btcellnet.net
Wed, 18 Apr 2001 16:16:53 +0100


Thanks Seb

It took a bit of adjustment, but it got me there.

The member.email needed to be in quotes to work properly.

I also added a <dtml-if member> clause so that content generated by non
members doesn't bug out.

Thanks again, particularly for the speed of response.
Steve

-----Original Message-----
From: seb bacon [mailto:seb@jamkit.com]

All member attributes are exposed as simple properties through a
wrapped Member object, which can be grabbed from the membership_tool.

You can get the Creator of a document through its DublinCore
interface, and you can get the Member object with getMemberById (a
method provided by CMFCore/MembershipTool.py), so an answer is:

   <dtml-let
member="portal_membership.getMemberById(_.getitem('Creator',1))">
      <dtml-var member.email>
   </dtml-let>

There may be a nicer way, though.  

seb

* Boddy Stephen <Stephen.Boddy@btcellnet.net> [010418 15:46]:
> Hi,
> 
> I'm trying to create a link in the standard_html_footer that when clicked
on
> will open an email to the owner of the currently viewed object i.e.
> 
> documentA is owned by member bob, who has an email property
> robert@builder.com
> A browser comes along who wants to email bob to tell him that his JCB
specs
> are out of date.
> A link at the footer of the page should point to
"mailto:robert@builder.com"
> 
> Using <dtml-if owner_info><dtml-with owner_info mapping> I can get the
last
> mod time, and the owner id (bob). How do I pull the owners email? Do I
have
> to resort to editing the python code?
> 
> On a related issue, it's easy enough to get the last modification date, is
> it as easy to get the last modifiers id and email property, or do I have
to
> start messing with the undoable_transactions (if memory serves)?
> 
> Thanks in advance
> Steve



**********************************************************************
This email and any attachments may be confidential and the subject of 
legal professional privilege.  Any disclosure, use, storage or copying 
of this email without the consent of the sender is strictly prohibited.
Please notify the sender immediately if you are not the intended 
recipient and then delete the email from your inbox and do not 
disclose the contents to another person, use, copy or store the 
information in any medium. 
**********************************************************************