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
Create a 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 Basic Newletter 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 copy the following code.
* * *
Update the Newsletter Text Rendering properties
Go to the content tab of the Newsletter Text rendering and add the Insert button to the Page editor Buttons field.
Select the ID source parameter template for the Parameter Template field to; templates/Modules/Email Campaign/ID Source Based Parameters ![]()
Add the Newsletter Text rendering to the branche template
Open the Basic Newsletter branch template and add the Newsletter Text rendering to the email-content placeholder of the $name template and Basic Newsletter template. Change for both of the renderings the datasource field to the Newsletter Text folder (/sitecore/templates/Branches/Modules/Email Campaign/Messages/Newsletter/Basic Newsletter/$name/Basic Newsletter/Newsletter Text).
Create a Basic Newsletter
Go to ECM and create a new Newsletter based on the Basic Newsletter template. The Branche template will generate the following tree structure:
And the preview will look something like this:
Click the Edit button to open the page editor. From the page editor we can add Newsletter Text items by selecting the Newsletter Text rendering and clicking the insert button (green cross) in the floating toolbar.
After clicking the insert button the insert dialog will appear where you can select the Newsletter text template configured in the insert options of the Newsletter Text folder in the branch template. Create a new item called Newsletter text item 1. Save and close the page editor and return to ECM preview. The preview should look like this:
You can see that the Newsletter text item 1 is created in the Newsletter Text folder.
If you preferred to use the content editor you can add new Newsletter Text items in the folder. This will also work for Sitecore 6.3 and lower. At this point the Basic Newsletter template is a bit more advanced. Start adding some styling and build some more controls. Take a look at the default Newsletter Message template for idea’s and examples. Special thanks to André van 't Hoog of Evident for his review on the articles. Enjoy, Pieter