if((select count(*) from dbo.pal_TemplateType where templateType = 'Postbox') = 0)
begin
INSERT INTO [dbo].[pal_TemplateType]
           ([templateType]
           ,[isActive]
           ,[sequence])
     VALUES
           ('Postbox'
           ,1
           ,11);
end;

if((select count(*) from dbo.pal_Template where templateName = 'E-mail to School Contacts Template') = 0)
begin
INSERT INTO [dbo].[pal_Template]
           ([templateTypeId]
           ,[templateName]
           ,[templateContent])
     VALUES
           (11
           ,'E-mail to School Contacts Template'
           ,'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Email Template</title>
        <style type="text/css">
            body {
            font-family:Trebuchet MS, Arial, Helvetica, sans-serif;
            font-size: 12px;
            }
        </style>
    </head>
    <body link="#BA4C14" alink="#BA4C14" class="RadEditorContentStyle">
        <div>
        <table style="border-collapse: collapse;" width="100%">
            <tbody>
               <tr>
                    <td align="left" valign="top">
                    {logo}
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    <br />
                    Hi there<br />
                    <br />
                    A new document has been uploaded to your school postbox.<br/><br/>
                    <strong>Main Section: </strong> {ParentFolder}<br/>
                    <strong>Sub-folder Path:  </strong>{SubfolderPath}<br/>
                    <strong>Document Name:  </strong>{FileName}<br/><br/>
                    <strong>Uploaded By:  </strong>{UploadedBy}<br/>
                    <strong>Upload Date:  </strong>{UploadDate}<br/><br/>
                    
                   
                    Thank you,<br />
                    IEB Team<br />
                    <p>&nbsp;</p>
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
    </body>
</html>');
end