AnsweredAssumed Answered

Get name of forum thread and of all site users?

Question asked by icrew on Feb 22, 2011
Latest reply on May 23, 2011 by icrew
Hi all:

I'm writing a script that's triggered by a rule anytime a discussion post is created or updated in a share site.  The idea is to send out an email with the contents of any new or updated posts to the users of the Share site.

I've made pretty decent progress (I can now send an email with the title and contents of a Discussions post, and can get to the node of the site that the Discussions are in.)  However, I'm stuck on two parts of this:

1) If the Discussions post is a reply to a topic, its "title" property is an empty string.  If I walk back up the tree with document.getParent(), I can't figure out how to check for a "title" property on the parent node.  Even when I know that the parent node does have a "title" property, that property (or other discussion-post-specific properties  like "content") don't show up.  I've tried running a for loop to show all of the properties of the parent (i.e. "for (var myProperty in parent.properties)"), and those discussion-post-specific properties just aren't there.  How do I get at those properties?

2) What's the easiest way to get a list of all the members of the site, so that I can send them email?  (I'm assuming that that'll be starting from the node representing the site, no?)

Thanks,

Ian

Outcomes