AnsweredAssumed Answered

Mail notifications: blog posts and blog comments

Question asked by efestione on Mar 29, 2011
Latest reply on Mar 31, 2011 by efestione
Hi all,
I would to send emails with different objects depending on the entry is a blog post or is a comment.

I think I must use a JS script because I would use some document informations in mail subject.

My questions are:
1. how can I distinguish between a blog post and a comment?

if (document.type == ???){
// create mail action
  var mail = actions.create("mail");
  mail.parameters.to = "me@mydomain.com";
  mail.parameters.subject = "Hello from JavaScript";
  mail.parameters.from = "alfresco@alfresco.com";
  mail.parameters.text = "new post";
  // execute action against a document  

}else{
  mail.parameters.text = "new comment";
}
  mail.execute(doc);


2. how can I refer to the post title in a "new comment" email? (like "John has commented -post title-")

Thanks
Alex

Outcomes