Creating a email notification when a new site is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 07:42 AM
I tried to create a rule and execute a script when a particular site is created
var parent = space.getParent();var siteShortName = space.getSiteShortName();var siteGroup = "GROUP_EMAIL_CONTRIBUTORS";var mail = actions.create("mail");mail.parameters.to_many = siteGroup; mail.parameters.subject=" A new site called" +siteShortName +"is created";mail.parameters.text="Login to share to join the site; //execute action against a documentmail.execute(document);
But I am getting the mail as "A new site callednullis created" as subject. It is not showing the site name instead it saying null
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 08:07 AM
logger.log(parent.properties.name);
I think you are triggering rule that is configured under Company Home/Sites folder.
Can you also print the value of this statement "document.properties.name" and let me know the value ?
logger.log(document.properties.name);
If I understand correctly, replacing the below code
mail.parameters.subject=" A new site called" +siteShortName +"is created";
with
mail.parameters.subject=" A new site called" + document.properties.name +"is created";
should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 08:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 08:28 AM
Company Home > Data Dictionary > Email Templates > invite > invite-email.html.ftl
Add the below statements before - mail.execute(document);
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/invite/invite-email.html.ftl");mail.parameters.text = "some text";
Modify the invite-email.html.ftl based on your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 08:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2014 09:02 AM
Go to Company Home/Sites - More Actions - Manage Content Rules.
Edit the rule.
Can you post here - 1) Step 1-Condition selected 2) Step 2-Action selected 3) Step 3- Value of the three checkboxes
On Step 3, uncheck the "Apply rule to subspaces" if selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2014 01:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2014 03:32 AM
Is it printing twice ?
2) Try editing the rule and change the condition from - "Description" to "All Items".
Save the rule. Check
3) Try editing the rule and change the condition from - "Description" to "Content of type or sub-type" is "Folder".
Save the rule. Check
Let me know the output of above three points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2014 05:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2014 05:44 AM
var siteGroup = "GROUP_EMAIL_CONTRIBUTORS";mail.parameters.to_many = siteGroup;
And this group may contain 2 users having same email id.
That is why it should be sending two emails.
Check by just keeping a single user in that group, you should receive only one email.
