In this post I will extend the basic e-mail template for Sitecore ECM with a title and text listing. With this e-mail template the business user can create new Title and Text items within the page-editor (Sitecore 6.4 and higher) or the content-editor (all versions of Sitecore). This article is a follow-up article of the Sitecore ECM: How to create a Email template from Scratch – Part I.
Create the Newsletter Text template
Createa template Newsletter Text with the following fields: Message Title and Message Text.
Add standard values for the Message Title and Message Text fields.
Add Newsletter Text folder to the Branche Template
Go to the BasicNewletter branche template and create a folder Newsletter Text. Assign the Newsletter Text template as Insert option.
Create Newsletter Text rendering
Create a new layout called Newsletter Text and copythe following code.
When using the Sitecore Rules Engine you don’t want your business user to see all the Conditions and Actions. Conditions and Actions are also items (everything is a Item ;-)) so you can apply security on them. Deny a user Read access on a Condition or Action and the user will not see them in the Rule Set Editor.
Create the role Deny Conditions
Open the Role Editor and create a new Role called Deny Conditions. Click Members and Add the business users to the role. Close the Role Manager.
Open the Security Editor en select the created role Deny Conditions. Go to SystemSettingsRulesConditional RenderingsConditions and deny read rights on the conditions (or folder) you want to hide for the business user. Repeat this for conditions in SystemSettingsRulesCommonConditions.
Login as the business user and open the Rule Set Editor
Now test the settings and log-in as the business user, go to the Marketing Center and create a new conditional rendering rule. All the condition where the read access is denied are not in the Rule Set Editor.
At this point the business user will only see condition he/she can understand.
In this How to I will build a custom condition for the Sitecore Rules Enginge. This How To is a proof of concepts based on a webinar (in Dutch) about the Rules Engine. I presented this webinar earlier this year and you can watch the webinar on Youtube by clicking this link.
Before we start writing code I’ll explain the business case we are trying to resolve.
The business user want to personalize the website based on the website the visitor comes from (the http referrer). For now he is only interested in Facebook and Twitter.
If the visitor visits our site from Facebook the Facebook Like button of our own Facebook page must be visible on the homepage.
If the visitor visits our site from Twitter our Twitter Tweet stream must be visible on the homepage.
Oke, Now start building it!
Create a template called Sidebar Text, this template has two field; a Sidebar Title (Single-Line Text field) and a Sidebar Text (Rich Text field).
Create a template called Standaard Text, this template one field called Text (Multi-line Text).
Set up the content tree
Create a folder called Sidebars and add two Sidebar Text items with the following values: