
if((select count(*) from dbo.pal_Template where templateName = 'WholesalerOrder Step1 E-mail Template') = 0)
begin

INSERT INTO [dbo].[pal_Template]
           ([templateTypeId]
           ,[templateName]
           ,[templateContent])
     VALUES
           (8
           ,'WholesalerOrder Step1 E-mail 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="center" valign="top">
                    {logo}
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><br />
                    Hi there<br />
                    <br />
                    Your new quote request has been created.<br />
                    <br />
                    <strong>Order Number: </strong>{OrderNumber}<br />
                    Login to view the order click  <a href="{link}" target="new_tab">here</a>.<br/><br/>
                    <u>REQUEST FROM</u><br/>
                    <strong>Retailer: </strong>{RetailerName}<br />
                    <strong>Contact: </strong>{UserName}<br />
                    <strong>Email: </strong>{UserEmailAddress}<br />
                    <strong>Number: </strong>{UserMobileNumber}<br />
                    <br />
                    <u>REQUEST TO</u><br/>
                    <strong>Wholesaler: </strong>{WholesalerUniqueName}<br />
                    <br />
                    <br />
                    Kind regards,<br />
                    {CompanyName}<br />
                    <p>&nbsp;</p>
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
    </body>
</html>');
end;

if((select count(*) from dbo.pal_Template where templateName = 'WholesalerOrder Step1 E-mail Subject') = 0)
begin

INSERT INTO [dbo].[pal_Template]
           ([templateTypeId]
           ,[templateName]
           ,[templateContent])
     VALUES
	 (8,
	 'WholesalerOrder Step1 E-mail Subject',
	 'REAPtech - Quote Request [{RetailerName}: {OrderNumber}]');
END;