cancel
Showing results for 
Search instead for 
Did you mean: 

Mail notifications: blog posts and blog comments

efestione
Champ in-the-making
Champ in-the-making
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
1 REPLY 1

efestione
Champ in-the-making
Champ in-the-making
can anyone help me?

Thanks and regards
Alex