Merging 1210493:1305499 to keep updated from trunk

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/20111205EmailHandling@1305581 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java b/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
index 46a8502..8a99ff3 100644
--- a/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
+++ b/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
@@ -884,7 +884,7 @@
             GenericValue productStoreEmail = null;
             String emailType = "PRDS_GC_PURCHASE";
             try {
-                productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", 
+                productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", 
                         UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Unable to get product store email setting for gift card purchase", module);
@@ -1130,7 +1130,7 @@
         GenericValue productStoreEmail = null;
         String emailType = "PRDS_GC_RELOAD";
         try {
-            productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
+            productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
         } catch (GenericEntityException e) {
             Debug.logError(e, "Unable to get product store email setting for gift card purchase", module);
         }
diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
index eaf5dae..06f9559 100644
--- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
+++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
@@ -1265,7 +1265,7 @@
             GenericValue productStoreEmail = null;
             String emailType = "PRDS_GC_PURCHASE";
             try {
-                productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
+                productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Unable to get product store email setting for gift card purchase", module);
             }
@@ -1517,7 +1517,7 @@
         GenericValue productStoreEmail = null;
         String emailType = "PRDS_GC_RELOAD";
         try {
-            productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
+            productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
         } catch (GenericEntityException e) {
             Debug.logError(e, "Unable to get product store email setting for gift card purchase", module);
         }
diff --git a/applications/content/config/ContentUiLabels.xml b/applications/content/config/ContentUiLabels.xml
index 7ced62e..e5cd808 100644
--- a/applications/content/config/ContentUiLabels.xml
+++ b/applications/content/config/ContentUiLabels.xml
@@ -5197,6 +5197,10 @@
         <value xml:lang="zh">新建数据资源网址</value>
         <value xml:lang="zh_TW">新建資料資源網址</value>
     </property>
+    <property key="PageTitleAddEmailTemplateSetup">
+        <value xml:lang="en">Add Email Template Setting</value>
+        <value xml:lang="fr">Ajouter un template de mél</value>
+    </property>
     <property key="PageTitleAddForumMessage">
         <value xml:lang="ar">إضافة رسالة إلى المنتدى</value>
         <value xml:lang="da">Tilføj en besked til forum: </value>
@@ -5832,6 +5836,10 @@
         <value xml:lang="zh">编辑电子文本</value>
         <value xml:lang="zh_TW">編輯電子文本</value>
     </property>
+    <property key="PageTitleEditEmailTemplateSetup">
+        <value xml:lang="en">Edit Email Template Setting</value>
+        <value xml:lang="fr">Modifier les modèles de mèl</value>
+    </property>
     <property key="PageTitleEditForumMessage">
         <value xml:lang="ar">تحرير رسالة</value>
         <value xml:lang="da">Ret besked</value>
diff --git a/applications/content/entitydef/entitymodel.xml b/applications/content/entitydef/entitymodel.xml
index 8195099..0e345fc 100644
--- a/applications/content/entitydef/entitymodel.xml
+++ b/applications/content/entitydef/entitymodel.xml
@@ -1124,6 +1124,47 @@
     </entity>
 
   <!-- ========================================================= -->
+  <!-- org.ofbiz.content.email -->
+  <!-- ========================================================= -->
+
+    <entity entity-name="EmailTemplateContent"
+            package-name="org.ofbiz.content.email"
+            title="Email Template And Content Association Entity">
+        <field name="emailTemplateSettingId" type="id-ne"/>
+        <field name="contentId" type="id-ne"/>
+        <field name="emailTemplateContentTypeId" type="id-ne"/>
+        <field name="fromDate" type="date-time"/>
+        <field name="thruDate" type="date-time"/>
+        <field name="description" type="description"/>
+        <prim-key field="emailTemplateContentTypeId"/>
+        <prim-key field="emailTemplateSettingId"/>
+        <prim-key field="contentId"/>
+        <prim-key field="fromDate"/>
+        <relation type="one" rel-entity-name="EmailTemplateSetting" fk-name="ETCONTENT_EMA">
+            <key-map field-name="emailTemplateSettingId"/>
+        </relation>
+        <relation type="one" rel-entity-name="EmailTemplateContentType" fk-name="ETCONTENT_TYP">
+            <key-map field-name="emailTemplateContentTypeId"/>
+        </relation>
+        <relation type="one" rel-entity-name="Content" fk-name="ETCONTENT_CON">
+            <key-map field-name="contentId"/>
+        </relation>
+    </entity>
+
+    <entity entity-name="EmailTemplateContentType"
+            package-name="org.ofbiz.content.email"
+            title="Email Template Content Type Entity">
+        <field name="emailTemplateContentTypeId" type="id-ne"/>
+        <field name="parentTypeId" type="id-ne"/>
+        <field name="hasTable" type="indicator"/>
+        <field name="description" type="description"/>
+        <prim-key field="emailTemplateContentTypeId"/>
+        <relation type="one" fk-name="PARENT_ETCT" title="Parent" rel-entity-name="EmailTemplateContentType">
+            <key-map field-name="parentTypeId" rel-field-name="emailTemplateContentTypeId"/>
+        </relation>
+    </entity>
+
+  <!-- ========================================================= -->
   <!-- org.ofbiz.content.preference -->
   <!-- ========================================================= -->
 
diff --git a/applications/content/webapp/content/WEB-INF/controller.xml b/applications/content/webapp/content/WEB-INF/controller.xml
index 9c95010..bcdef2a 100644
--- a/applications/content/webapp/content/WEB-INF/controller.xml
+++ b/applications/content/webapp/content/WEB-INF/controller.xml
@@ -1360,6 +1360,27 @@
         <response name="error" type="view" value="EditContentRevisionItem"/>
     </request-map>
 
+    <!-- ================ Email Template Setting Requests ================= -->
+    <request-map uri="EditEmailTemplateSetting"><security auth="true" https="true"/><response name="success" type="view" value="EditEmailTemplateSetting"/></request-map>
+    <request-map uri="CreateEmailTemplateSetting">
+        <security auth="true" https="true"/>
+        <event invoke="createEmailTemplateSetting" type="service"/>
+        <response name="success" type="view" value="EditEmailTemplateSetting"/>
+        <response name="error" type="view" value="EditEmailTemplateSetting"/>
+    </request-map>
+    <request-map uri="UpdateEmailTemplateSetting">
+        <security auth="true" https="true"/>
+        <event invoke="updateEmailTemplateSetting" type="service"/>
+        <response name="success" type="view" value="EditEmailTemplateSetting"/>
+        <response name="error" type="view" value="EditEmailTemplateSetting"/>
+    </request-map>
+    <request-map uri="RemoveEmailTemplateSetting">
+        <security auth="true" https="true"/>
+        <event invoke="removeEmailTemplateSetting" type="service"/>
+        <response name="success" type="view" value="EditEmailTemplateSetting"/>
+        <response name="error" type="view" value="EditEmailTemplateSetting"/>
+    </request-map>
+
     <!-- ================ Survey Requests ================= -->
     <request-map uri="FindSurvey"><security auth="true" https="true"/><response name="success" type="view" value="FindSurvey"/></request-map>
     <request-map uri="ListFindSurveySearchResults">
@@ -2006,7 +2027,8 @@
     <view-map name="EditContentTypeAttr" page="component://content/widget/contentsetup/ContentSetupScreens.xml#EditContentTypeAttr" type="screen"/>
     <view-map name="EditContentAssocPredicate" page="component://content/widget/contentsetup/ContentSetupScreens.xml#EditContentAssocPredicate" type="screen"/>
     <view-map name="EditContentOperation" page="component://content/widget/contentsetup/ContentSetupScreens.xml#EditContentOperation" type="screen"/>
-    <view-map name="EditContentPurposeOperation"  page="component://content/widget/contentsetup/ContentSetupScreens.xml#EditContentPurposeOperation" type="screen"/>
+    <view-map name="EditContentPurposeOperation" page="component://content/widget/contentsetup/ContentSetupScreens.xml#EditContentPurposeOperation" type="screen"/>
+    <view-map name="EditEmailTemplateSetting" page="component://content/widget/contentsetup/ContentSetupScreens.xml#EditEmailTemplateSetting" type="screen"/>
     <view-map name="EditContentWorkEfforts" page="component://content/widget/content/ContentScreens.xml#EditContentWorkEfforts" type="screen"/>
     <view-map name="EditContentKeywords" type="screen" page="component://content/widget/content/ContentScreens.xml#EditContentKeywords"/>
 
diff --git a/applications/content/widget/EmailScreens.xml b/applications/content/widget/EmailScreens.xml
index 8b8c35e..b5ba883 100644
--- a/applications/content/widget/EmailScreens.xml
+++ b/applications/content/widget/EmailScreens.xml
@@ -19,6 +19,8 @@
 
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
+
+
     <!-- Simple service notification screen -->
     <screen name="ServiceNotification">
         <section>
diff --git a/applications/content/widget/contentsetup/ContentSetupForms.xml b/applications/content/widget/contentsetup/ContentSetupForms.xml
index 17fd94e..0fa094d 100644
--- a/applications/content/widget/contentsetup/ContentSetupForms.xml
+++ b/applications/content/widget/contentsetup/ContentSetupForms.xml
@@ -230,4 +230,289 @@
             </hyperlink>
         </field>
     </form>
+
+    <!-- Email Template Setting Forms -->
+    <form name="CreateEmailTemplateSetting" target="CreateEmailTemplateSetting" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createEmailTemplateSetting"/>
+        <field name="emailTemplateSettingId"><ignored/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit/></field>
+    </form>
+
+    <form name="UpdateEmailTemplateSettings" target="UpdateEmailTemplateSetting" type="list" separate-columns="true"
+          odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <set field="sortField" from-field="parameters.sortField" default-value="emailTemplateSettingId"/>
+            <entity-condition entity-name="EmailTemplateSetting" use-cache="false">
+                <order-by field-name="${sortField}"/>
+            </entity-condition>
+        </actions>
+        <auto-fields-service service-name="updateEmailTemplateSetting"/>
+        <field name="emailTemplateSettingId"><display/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit/></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="RemoveEmailTemplateSetting">
+                <parameter param-name="emailTemplateSettingId"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <!-- Email Template Setting Forms -->
+    <form name="CreateEmailTemplateSetting" target="CreateEmailTemplateSetting" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createEmailTemplateSetting"/>
+        <field name="emailTemplateSettingId"><ignored/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit/></field>
+    </form>
+
+    <form name="UpdateEmailTemplateSettings" target="UpdateEmailTemplateSetting" type="list" separate-columns="true"
+          odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <set field="sortField" from-field="parameters.sortField" default-value="emailTemplateSettingId"/>
+            <entity-condition entity-name="EmailTemplateSetting" use-cache="false">
+                <order-by field-name="${sortField}"/>
+            </entity-condition>
+        </actions>
+        <auto-fields-service service-name="updateEmailTemplateSetting"/>
+        <field name="emailTemplateSettingId"><display/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit/></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="RemoveEmailTemplateSetting">
+                <parameter param-name="emailTemplateSettingId"/>
+            </hyperlink>
+        </field>
+    </form>
+</forms>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
+    <!-- ContentType forms -->
+    <form name="AddContentType" target="addContentType" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentType"/>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentType" list-name="contentList" target="updateContentType" title="" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+          <entity-condition entity-name="ContentType" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="updateContentType"/>
+        <field name="contentTypeId" widget-style="tabletext">
+            <display/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentType">
+                <parameter param-name="contentTypeId"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <!-- ContentTypeAttr forms -->
+    <form name="AddContentTypeAttr" target="addContentTypeAttr" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentTypeAttr"/>
+        <field entity-name="ContentType" name="contentTypeId">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}"
+                    entity-name="ContentType" key-field-name="contentTypeId"/>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentTypeAttr" list-name="contentList" target="updateContentTypeAttr" title="" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+        <entity-condition entity-name="ContentTypeAttr" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="createContentTypeAttr"/>
+        <field name="contentTypeId">
+            <display/>
+        </field>
+        <field name="attrName">
+            <display/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentTypeAttr">
+                <parameter param-name="contentTypeId"/>
+                <parameter param-name="attrName"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <!-- ContentAssocType forms -->
+    <form name="AddContentAssocType" target="addContentAssocType" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentAssocType"/>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentAssocType" list-name="contentList" target="updateContentAssocType" title="" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-condition entity-name="ContentAssocType" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="updateContentAssocType"/>
+        <field name="contentAssocTypeId" widget-style="tabletext">
+            <display/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentAssocType">
+                <parameter param-name="contentAssocTypeId"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <!-- ContentPurposeType forms -->
+    <form name="AddContentPurposeType" target="addContentPurposeType" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentPurposeType"/>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentPurposeType" list-name="contentList" target="updateContentPurposeType" title="" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-condition entity-name="ContentPurposeType" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="updateContentPurposeType"/>
+        <field name="contentPurposeTypeId" widget-style="tabletext">
+            <display/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentPurposeType">
+                <parameter param-name="contentPurposeTypeId"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <!-- ContentAssocPredicate forms -->
+   <form name="AddContentAssocPredicate" target="addContentAssocPredicate" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentAssocPredicate"/>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentAssocPredicate" list-name="contentList" target="updateContentAssocPredicate" title="" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-condition entity-name="ContentAssocPredicate" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="updateContentAssocPredicate"/>
+        <field name="contentAssocPredicateId" widget-style="tabletext">
+            <display/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentAssocPredicate">
+                <parameter param-name="contentAssocPredicateId"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <!-- ContentOperation forms -->
+    <form name="AddContentOperation" target="addContentOperation" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentOperation"/>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentOperation" list-name="contentList" target="updateContentOperation" title="" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-condition entity-name="ContentOperation" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="updateContentOperation"/>
+        <field name="contentOperationId" widget-style="tabletext">
+            <display/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentOperation">
+                <parameter param-name="contentOperationId"/>
+            </hyperlink>
+        </field>
+    </form>
+    <!-- ContentPurposeOperation forms -->
+    <form name="AddContentPurposeOperation" target="addContentPurposeOperation" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createContentPurposeOperation"/>
+        <field name="contentPurposeTypeId">
+            <drop-down allow-empty="true">
+                <entity-options description="${description}"
+                    entity-name="ContentPurposeType" key-field-name="contentPurposeTypeId"/>
+            </drop-down>
+        </field>
+        <field name="contentOperationId">
+            <drop-down allow-empty="true">
+                <entity-options description="${description}"
+                    entity-name="ContentOperation" key-field-name="contentOperationId"/>
+            </drop-down>
+        </field>
+        <field name="roleTypeId">
+            <drop-down allow-empty="true">
+                <entity-options description="${description}"
+                    entity-name="RoleType" key-field-name="roleTypeId"/>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="UpdateContentPurposeOperation" target="" title="" type="list" list-name="contentList"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-one entity-name="ContentPurposeOperation" use-cache="false"/>
+        </actions>
+        <auto-fields-service service-name="updateContentPurposeOperation" default-field-type="display"/>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="removeContentPurposeOperation">
+                <parameter param-name="contentPurposeTypeId"/>
+                <parameter param-name="contentOperationId"/>
+                <parameter param-name="roleTypeId"/>
+                <parameter param-name="statusId"/>
+                <parameter param-name="privilegeEnumId"/>
+            </hyperlink>
+        </field>
+    </form>
 </forms>
diff --git a/applications/content/widget/contentsetup/ContentSetupMenus.xml b/applications/content/widget/contentsetup/ContentSetupMenus.xml
index 3c7d49d..0d27881 100644
--- a/applications/content/widget/contentsetup/ContentSetupMenus.xml
+++ b/applications/content/widget/contentsetup/ContentSetupMenus.xml
@@ -52,6 +52,10 @@
             <link target="EditContentType" target-window="_top" style="tabButton"/>
         </menu-item>
 
+        <menu-item name="email" title="${uiLabelMap.PageTitleEditEmailTemplateSetup}" >
+            <link target="EditEmailTemplateSetting" target-window="_top" style="tabButton"/>
+        </menu-item>
+
         <menu-item name="userpermissions" title="${uiLabelMap.PageTitleEditContentUserPermissions}" >
             <link name="UserPermissions" target="UserPermissions" target-window="_top" style="tabButton"/>
         </menu-item>
diff --git a/applications/content/widget/contentsetup/ContentSetupScreens.xml b/applications/content/widget/contentsetup/ContentSetupScreens.xml
index 90c07f4..fc118d0 100644
--- a/applications/content/widget/contentsetup/ContentSetupScreens.xml
+++ b/applications/content/widget/contentsetup/ContentSetupScreens.xml
@@ -183,4 +183,26 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="EditEmailTemplateSetting">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditEmailTemplateSetup" />
+                <set field="headerItem" value="ContentSetupMenu" />
+                <set field="currentMenuItemName" to-scope="user" value="email"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="commonContentSetupDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.PageTitleEditEmailTemplateSetup}">
+                            <include-form name="UpdateEmailTemplateSettings" location="component://content/widget/contentsetup/ContentSetupForms.xml"/>
+                        </screenlet>
+                        <screenlet title="${uiLabelMap.PageTitleAddEmailTemplateSetup}">
+                            <include-form name="CreateEmailTemplateSetting" location="component://content/widget/contentsetup/ContentSetupForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
diff --git a/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml b/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
index 83b3a13..e8c6bb6 100644
--- a/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
+++ b/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
@@ -545,7 +545,7 @@
             </entity-one>
             <set field="productStoreId" from-field="webSite.productStoreId"/>
         </if-empty>
-        <entity-one entity-name="ProductStoreEmailSetting" value-field="storeEmail" auto-field-map="false">
+        <entity-one entity-name="OldProdStoreEmailSetting" value-field="storeEmail" auto-field-map="false">
             <field-map field-name="productStoreId" from-field="productStoreId"/>
             <field-map field-name="emailType" value="SUB_CONT_LIST_NOTI"/>
         </entity-one>
@@ -609,7 +609,7 @@
             </entity-one>
             <set field="productStoreId" from-field="webSite.productStoreId"/>
         </if-empty>
-        <entity-one entity-name="ProductStoreEmailSetting" value-field="storeEmail" auto-field-map="false">
+        <entity-one entity-name="OldProdStoreEmailSetting" value-field="storeEmail" auto-field-map="false">
             <field-map field-name="productStoreId" from-field="productStoreId"/>
             <field-map field-name="emailType" value="UNSUB_CONT_LIST_VERI"/>
         </entity-one>
@@ -658,7 +658,7 @@
             </entity-one>
             <set field="productStoreId" from-field="webSite.productStoreId"/>
         </if-empty>
-        <entity-one entity-name="ProductStoreEmailSetting" value-field="storeEmail" auto-field-map="false">
+        <entity-one entity-name="OldProdStoreEmailSetting" value-field="storeEmail" auto-field-map="false">
             <field-map field-name="productStoreId" from-field="productStoreId"/>
             <field-map field-name="emailType" value="UNSUB_CONT_LIST_NOTI"/>
         </entity-one>
diff --git a/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java b/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
index 3af8054..349d2de 100644
--- a/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
+++ b/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
@@ -250,7 +250,7 @@
 
             GenericValue productStoreEmail = null;
             try {
-                productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
+                productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
             }
@@ -301,7 +301,7 @@
         }
 
         return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceProduct, 
-                "ProductProductStoreEmailSettingsNotValid", 
+                "ProductOldProdStoreEmailSettingsNotValid", 
                     UtilMisc.toMap("productStoreId", productStoreId, 
                             "emailType", emailType), locale));
     }
diff --git a/applications/order/src/org/ofbiz/order/order/OrderServices.java b/applications/order/src/org/ofbiz/order/order/OrderServices.java
index a1aaea7..48d5b00 100644
--- a/applications/order/src/org/ofbiz/order/order/OrderServices.java
+++ b/applications/order/src/org/ofbiz/order/order/OrderServices.java
@@ -2489,7 +2489,7 @@
         return sendOrderNotificationScreen(ctx, context, "PRDS_ODR_PAYRETRY");
     }
 
-    protected static Map<String, Object> sendOrderNotificationScreen(DispatchContext dctx, Map<String, ? extends Object> context, String emailType) {
+    protected static Map<String, Object> sendOrderNotificationScreen(DispatchContext dctx, Map<String, ? extends Object> context, String emailTypeEnumId) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -2507,7 +2507,16 @@
         }
 
         // prepare the order information
-        Map<String, Object> sendMap = FastMap.newInstance();
+        Map<String, Object> sendMap = null;
+        try {
+            sendMap = dctx.makeValidContext("sendMailFromTemplateSetting", "IN", context);
+        } catch (Exception e) {
+            Debug.logError(e, module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, 
+                    "OrderServiceExceptionSeeLogs", localePar));
+        }
+
+        
 
         // get the order header and store
         GenericValue orderHeader = null;
@@ -2522,38 +2531,28 @@
                     "OrderOrderNotFound", UtilMisc.toMap("orderId", orderId), localePar));
         }
 
-        if (orderHeader.get("webSiteId") == null) {
-            return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, 
-                    "OrderOrderWithoutWebSite", UtilMisc.toMap("orderId", orderId), localePar));
-        }
 
-        GenericValue productStoreEmail = null;
+        List<GenericValue> productStoreEmails = null;
+        EntityCondition mainCond = EntityCondition.makeCondition(UtilMisc.toList(
+                EntityExpr.makeCondition("productStoreId", orderHeader.get("productStoreId")),
+                EntityExpr.makeCondition("emailTypeEnumId", emailTypeEnumId),
+                EntityExpr.makeConditionDate("fromDate", "thruDate")));
         try {
-            productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", orderHeader.get("productStoreId"), "emailType", emailType));
+            productStoreEmails = delegator.findList("ProdStoreEmailAndTemplateSettingView", mainCond, UtilMisc.toSet("emailTemplateSettingId", "bodyScreenLocation"), null, null, true);
         } catch (GenericEntityException e) {
-            Debug.logError(e, "Problem getting the ProductStoreEmailSetting for productStoreId=" + orderHeader.get("productStoreId") + " and emailType=" + emailType, module);
+            Debug.logError(e, "Problem getting EmailTemplateSettings for productStoreId = " + orderHeader.get("productStoreId") + " and emailType = " + emailTypeEnumId, module);
         }
-        if (productStoreEmail == null) {
+        if (UtilValidate.isEmpty(productStoreEmails)) {
             return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceProduct, 
-                    "ProductProductStoreEmailSettingsNotValid", 
+                    "ProductProdStoreEmailSettingsNotValid", 
                     UtilMisc.toMap("productStoreId", orderHeader.get("productStoreId"), 
-                            "emailType", emailType), localePar));
-        }
-
-        // the override screenUri
-        if (UtilValidate.isEmpty(screenUri)) {
-            String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
-            if (UtilValidate.isEmpty(bodyScreenLocation)) {
-                bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
-            }
-            sendMap.put("bodyScreenUri", bodyScreenLocation);
-            String xslfoAttachScreenLocation = productStoreEmail.getString("xslfoAttachScreenLocation");
-            sendMap.put("xslfoAttachScreenLocation", xslfoAttachScreenLocation);
-        } else {
-            sendMap.put("bodyScreenUri", screenUri);
+                            "emailType", emailTypeEnumId), localePar));
         }
 
         // website
+        if (orderHeader.get("webSiteId") == null) {
+            Debug.logWarning(UtilProperties.getMessage(resource, "OrderOrderWithoutWebSite", UtilMisc.toMap("orderId", orderId), localePar), module);
+        }
         sendMap.put("webSiteId", orderHeader.get("webSiteId"));
 
         OrderReadHelper orh = new OrderReadHelper(orderHeader);
@@ -2593,42 +2592,44 @@
         Map<String, Object> bodyParameters = UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "userLogin", placingUserLogin, "locale", locale);
         if (placingParty!= null) {
             bodyParameters.put("partyId", placingParty.get("partyId"));
+            sendMap.put("partyIdTo", placingParty.get("partyId"));
         }
         bodyParameters.put("note", note);
         sendMap.put("bodyParameters", bodyParameters);
         sendMap.put("userLogin",userLogin);
 
-        String subjectString = productStoreEmail.getString("subject");
-        sendMap.put("subject", subjectString);
-
-        sendMap.put("contentType", productStoreEmail.get("contentType"));
-        sendMap.put("sendFrom", productStoreEmail.get("fromAddress"));
-        sendMap.put("sendCc", productStoreEmail.get("ccAddress"));
-        sendMap.put("sendBcc", productStoreEmail.get("bccAddress"));
-        if ((sendTo != null) && UtilValidate.isEmail(sendTo)) {
-            sendMap.put("sendTo", sendTo);
-        } else {
+        if (sendTo == null || ! UtilValidate.isEmail(sendTo)) {
             sendMap.put("sendTo", emailString);
         }
-        if ((sendCc != null) && UtilValidate.isEmail(sendCc)) {
-            sendMap.put("sendCc", sendCc);
-        } else {
-            sendMap.put("sendCc", productStoreEmail.get("ccAddress"));
-        }
 
-        // send the notification
         Map<String, Object> sendResp = null;
-        try {
-            sendResp = dispatcher.runSync("sendMailFromScreen", sendMap);
-        } catch (Exception e) {
-            Debug.logError(e, module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, 
-                    "OrderServiceExceptionSeeLogs",locale));
+        for (GenericValue productStoreEmail : productStoreEmails) {
+            sendMap.put("emailTemplateSettingId", productStoreEmail.getString("emailTemplateSettingId"));
+            // the override screenUri
+            if (UtilValidate.isEmpty(screenUri)) {
+                String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
+                if (UtilValidate.isEmpty(bodyScreenLocation)) {
+                    bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailTypeEnumId);
+                }
+                sendMap.put("bodyScreenUri", bodyScreenLocation);
+            } else {
+                sendMap.put("bodyScreenUri", screenUri);
+            }
+
+            // send the notification
+            try {
+                sendResp = dispatcher.runSync("sendMailFromTemplateSetting", sendMap);
+            } catch (Exception e) {
+                Debug.logError(e, module);
+                return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, 
+                        "OrderServiceExceptionSeeLogs", localePar));
+            }
+            if (ServiceUtil.isError(sendResp)) break;
         }
 
         // check for errors
         if (sendResp != null && !ServiceUtil.isError(sendResp)) {
-            sendResp.put("emailType", emailType);
+            sendResp.put("emailType", emailTypeEnumId);
         }
         if (UtilValidate.isNotEmpty(orderId)) {
             sendResp.put("orderId", orderId);
diff --git a/applications/order/src/org/ofbiz/order/quote/QuoteServices.java b/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
index 6ea7939..c00e957 100644
--- a/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
+++ b/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
@@ -76,20 +76,20 @@
 
         GenericValue productStoreEmail = null;
         try {
-            productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", quote.get("productStoreId"), "emailType", emailType));
+            productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", quote.get("productStoreId"), "emailType", emailType));
         } catch (GenericEntityException e) {
-            Debug.logError(e, "Problem getting the ProductStoreEmailSetting for productStoreId=" + quote.get("productStoreId") + " and emailType=" + emailType, module);
+            Debug.logError(e, "Problem getting the OldProdStoreEmailSetting for productStoreId=" + quote.get("productStoreId") + " and emailType=" + emailType, module);
         }
         if (productStoreEmail == null) {
             return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceProduct, 
-                    "ProductProductStoreEmailSettingsNotValid", 
+                    "ProductOldProdStoreEmailSettingsNotValid", 
                     UtilMisc.toMap("productStoreId", quote.get("productStoreId"), 
                             "emailType", emailType), locale));
         }
         String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
         if (UtilValidate.isEmpty(bodyScreenLocation)) {
             return ServiceUtil.returnFailure(UtilProperties.getMessage(resourceProduct, 
-                    "ProductProductStoreEmailSettingsNotValidBodyScreenLocation", 
+                    "ProductOldProdStoreEmailSettingsNotValidBodyScreenLocation", 
                     UtilMisc.toMap("productStoreId", quote.get("productStoreId"), 
                             "emailType", emailType), locale));
         }
@@ -99,7 +99,7 @@
 
         if ((sendTo == null) || !UtilValidate.isEmail(sendTo)) {
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceProduct, 
-                    "ProductProductStoreEmailSettingsNoSendToFound", locale));
+                    "ProductOldProdStoreEmailSettingsNoSendToFound", locale));
         }
 
         Map<String, Object> bodyParameters = UtilMisc.<String, Object>toMap("quoteId", quoteId, "userLogin", userLogin, "locale", locale);
diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/order/SendConfirmationEmail.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/order/SendConfirmationEmail.groovy
index 4134a1a..134d274 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/actions/order/SendConfirmationEmail.groovy
+++ b/applications/order/webapp/ordermgr/WEB-INF/actions/order/SendConfirmationEmail.groovy
@@ -34,10 +34,10 @@
 donePage = request.getParameter("DONE_PAGE") ?: "orderview";
 context.donePage = donePage;
 
-// Provide the correct order confirmation ProductStoreEmailSetting, if one exists
+// Provide the correct order confirmation OldProdStoreEmailSetting, if one exists
 orderHeader = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]);
 if (orderHeader.productStoreId) {
-    productStoreEmailSetting = delegator.findByPrimaryKeyCache("ProductStoreEmailSetting", [productStoreId : orderHeader.productStoreId, emailType : emailType]);
+    productStoreEmailSetting = delegator.findByPrimaryKeyCache("OldProdStoreEmailSetting", [productStoreId : orderHeader.productStoreId, emailType : emailType]);
     if (productStoreEmailSetting) {
         context.productStoreEmailSetting = productStoreEmailSetting;
     }
diff --git a/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml b/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
index c8c0161..6555af6 100644
--- a/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
+++ b/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
@@ -662,7 +662,7 @@
             <result-to-field result-name="emailAddress"/>
         </call-service>
         
-        <entity-one entity-name="ProductStoreEmailSetting" value-field="productStoreEmailSetting"/>
+        <entity-one entity-name="OldProdStoreEmailSetting" value-field="productStoreEmailSetting"/>
         <set field="bodyParameters.partyId" from-field="parameters.partyIdTo"/>
         <set field="bodyParameters.email" from-field="parameters.emailAddress"/>
         <set field="bodyParameters.firstName" from-field="parameters.firstName"/>
diff --git a/applications/party/script/org/ofbiz/party/contact/ContactMechServices.xml b/applications/party/script/org/ofbiz/party/contact/ContactMechServices.xml
index cba277f..e05a5cd 100644
--- a/applications/party/script/org/ofbiz/party/contact/ContactMechServices.xml
+++ b/applications/party/script/org/ofbiz/party/contact/ContactMechServices.xml
@@ -271,7 +271,7 @@
     </simple-method>
 
     <simple-method method-name="sendVerifyEmailAddressNotification" short-description="Send an email to the person for Verification of his Email Address" login-required="false">
-        <entity-condition entity-name="ProductStoreEmailSetting" list="productStoreEmailSettings">
+        <entity-condition entity-name="OldProdStoreEmailSetting" list="productStoreEmailSettings">
             <condition-list>
                 <condition-expr field-name="emailType" operator="equals" value="PRDS_EMAIL_VERIFY"/>
             </condition-list>
diff --git a/applications/party/script/org/ofbiz/party/party/PartyServices.xml b/applications/party/script/org/ofbiz/party/party/PartyServices.xml
index 97965e8..64dccf4 100644
--- a/applications/party/script/org/ofbiz/party/party/PartyServices.xml
+++ b/applications/party/script/org/ofbiz/party/party/PartyServices.xml
@@ -959,7 +959,7 @@
         <if-empty field="productStoreId">
             <log level="warning" message="No productStoreId specified."/>
         </if-empty>
-        <entity-one entity-name="ProductStoreEmailSetting" value-field="storeEmail">
+        <entity-one entity-name="OldProdStoreEmailSetting" value-field="storeEmail">
             <field-map field-name="emailType"/>
             <field-map field-name="productStoreId"/>
         </entity-one>
@@ -992,7 +992,7 @@
         <if-empty field="productStoreId">
             <log level="warning" message="No productStoreId specified."/>
         </if-empty>
-        <entity-one entity-name="ProductStoreEmailSetting" value-field="storeEmail">
+        <entity-one entity-name="OldProdStoreEmailSetting" value-field="storeEmail">
             <field-map field-name="emailType" value="UPD_PRSNL_INF_CNFRM"/>
             <field-map field-name="productStoreId"/>
         </entity-one>
diff --git a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
index 1dbb235..cf4cb1e 100644
--- a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
+++ b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
@@ -398,7 +398,7 @@
                         if (UtilValidate.isNotEmpty(webSite)) {
                             GenericValue productStore = webSite.getRelatedOne("ProductStore");
                             if (UtilValidate.isNotEmpty(productStore)) {
-                                List<GenericValue> productStoreEmailSettings = productStore.getRelatedByAnd("ProductStoreEmailSetting", UtilMisc.toMap("emailType", "CONT_EMAIL_TEMPLATE"));
+                                List<GenericValue> productStoreEmailSettings = productStore.getRelatedByAnd("OldProdStoreEmailSetting", UtilMisc.toMap("emailType", "CONT_EMAIL_TEMPLATE"));
                                 GenericValue productStoreEmailSetting = EntityUtil.getFirst(productStoreEmailSettings);
                                 if (UtilValidate.isNotEmpty(productStoreEmailSetting)) {
                                     // send e-mail using screen template
diff --git a/applications/product/config/ProductUiLabels.xml b/applications/product/config/ProductUiLabels.xml
index 5d28f38..51869a4 100644
--- a/applications/product/config/ProductUiLabels.xml
+++ b/applications/product/config/ProductUiLabels.xml
@@ -10215,6 +10215,7 @@
         <value xml:lang="zh">承诺有效/现货数量或序列#</value>
         <value xml:lang="zh_TW">承諾有效/現貨數量或序列#</value>
     </property>
+    <!-- deprecated pass to FormFieldTitle_bodyScreenLocation on CommonUilabels.xml
     <property key="ProductAttachmentScreenLocation">
         <value xml:lang="de">Anhang Screen Pfad (XSL-FO)</value>
         <value xml:lang="en">Attachment Screen Location (XSL-FO)</value>
@@ -10227,6 +10228,7 @@
         <value xml:lang="zh">附件屏幕位置 (XSL-FO)</value>
         <value xml:lang="zh_TW">附件螢幕位置 (XSL-FO)</value>
     </property>
+    -->
     <property key="ProductAttributes">
         <value xml:lang="de">Attribute</value>
         <value xml:lang="en">Attributes</value>
@@ -10463,6 +10465,7 @@
         <value xml:lang="zh">箱号</value>
         <value xml:lang="zh_TW">箱號</value>
     </property>
+    <!-- deprecated pass to FormFieldTitle_bodyScreenLocation on CommonUilabels.xml
     <property key="ProductBodyScreenLocation">
         <value xml:lang="de">Body Screen Pfad</value>
         <value xml:lang="en">Body Screen Location</value>
@@ -10475,6 +10478,7 @@
         <value xml:lang="zh">主体屏幕位置</value>
         <value xml:lang="zh_TW">主體螢幕位置</value>
     </property>
+    -->
     <property key="ProductBox">
         <value xml:lang="de">Kiste</value>
         <value xml:lang="en">Box</value>
@@ -12566,6 +12570,10 @@
         <value xml:lang="zh">删除全部关键字</value>
         <value xml:lang="zh_TW">刪除全部關鍵字</value>
     </property>
+    <property key="ProductDeprecatedProductStoreEmailScreen">
+        <value xml:lang="en">Deprecated Screen, use it only for old email send process that not be migrate on template email system !</value>
+        <value xml:lang="fr">Écran déprécié, utilisez cet écran que pour les processus d'envoie de mél qui n'aurait pas migrés vers le nouveau système de modèle de mél !</value>
+    </property>
     <property key="ProductDepth">
         <value xml:lang="de">Tiefe</value>
         <value xml:lang="en">Depth</value>
@@ -18346,6 +18354,10 @@
         <value xml:lang="zh">制造商给的标识 </value>
         <value xml:lang="zh_TW">製造商給的ID </value>
     </property>
+    <property key="ProductOldProductStoreEmails">
+        <value xml:lang="en">(Old) Emails</value>
+        <value xml:lang="fr">(Déprécié)Adr. Courriel</value>
+    </property>
     <property key="ProductOneInventoryFacility">
         <value xml:lang="de">Eine Lagereinrichtung</value>
         <value xml:lang="en">One Inventory Facility</value>
@@ -20203,7 +20215,7 @@
         <value xml:lang="zh">产品店铺</value>
         <value xml:lang="zh_TW">產品商店</value>
     </property>
-    <property key="ProductProductStoreEmailSettings">
+    <property key="ProductOldProdStoreEmailSettings">
         <value xml:lang="de">Laden E-Mail Einstellungen</value>
         <value xml:lang="en">Product Store Email Settings</value>
         <value xml:lang="es">Configuración de Email de la tienda</value>
@@ -20215,15 +20227,15 @@
         <value xml:lang="zh">产品店铺电子邮件设置</value>
         <value xml:lang="zh_TW">產品商店電子郵件設置</value>
     </property>
-    <property key="ProductProductStoreEmailSettingsNotValid">
+    <property key="ProductOldProdStoreEmailSettingsNotValid">
         <value xml:lang="en">No valid email setting for store with productStoreId ${productStoreId} and emailType ${emailType}</value>
         <value xml:lang="it">Nessuna configurazione email valida per il negozio ${productStoreId} e tipo email ${emailType}</value>
     </property>
-    <property key="ProductProductStoreEmailSettingsNotValidBodyScreenLocation">
+    <property key="ProductOldProdStoreEmailSettingsNotValidBodyScreenLocation">
         <value xml:lang="en">No valid bodyScreenLocation in email setting for store with productStoreId ${productStoreId} and emailType ${emailType}</value>
         <value xml:lang="it">Nessun bodyScreenLocation valida nella configurazione email per il negozio ${productStoreId} e tipo email ${emailType}</value>
     </property>
-    <property key="ProductProductStoreEmailSettingsNoSendToFound">
+    <property key="ProductOldProdStoreEmailSettingsNoSendToFound">
         <value xml:lang="en">No sendTo email address found</value>
         <value xml:lang="it">Nessun indirizzo destinatario email trovato</value>
     </property>
@@ -23959,6 +23971,10 @@
         <value xml:lang="zh">店铺名称</value>
         <value xml:lang="zh_TW">商店名稱</value>
     </property>
+    <property key="ProductStoreEmailSettingMigration">
+        <value xml:lang="en">Migrate from old email setting system on productStore: ${productStoreId}</value>
+        <value xml:lang="fr">Depuis la migration de l'ancien system de mail du centre de profit : ${productStoreId}</value>
+    </property>
     <property key="ProductStoreNameId">
         <value xml:lang="de">Laden Namen [ID]</value>
         <value xml:lang="en">Store Name [ID]</value>
diff --git a/applications/product/entitydef/entitymodel.xml b/applications/product/entitydef/entitymodel.xml
index 3ec2389..4b386f3 100644
--- a/applications/product/entitydef/entitymodel.xml
+++ b/applications/product/entitydef/entitymodel.xml
@@ -3853,9 +3853,10 @@
         <key-map field-name="prodCatalogId"/>
       </relation>
     </entity>
-    <entity entity-name="ProductStoreEmailSetting"
+    <entity entity-name="OldProdStoreEmailSetting" table-name="PRODUCT_STORE_EMAIL_SETTING"
             package-name="org.ofbiz.product.store"
-            title="Product Store Email Settings Entity">
+            title="Old Product Store Email Settings Entity">
+            <description>Deprecated entity to manage email setting on a ProductStore. Now use ProdStoreEmailSettingType and EmailTemplateSettingId entities</description>
       <field name="productStoreId" type="id-ne"></field>
       <field name="emailType" type="id-ne"></field>
       <field name="bodyScreenLocation" type="long-varchar"><description>if empty defaults to a screen based on the emailType</description></field>
@@ -3874,6 +3875,29 @@
         <key-map field-name="emailType" rel-field-name="enumId"/>
       </relation>
     </entity>
+    <entity entity-name="ProdStoreEmailTplSetting"
+            package-name="org.ofbiz.product.store"
+            title="Product Store Email Settings Entity">
+      <field name="emailTemplateSettingId" type="id-ne"/>
+      <field name="productStoreId" type="id-ne"/>
+      <field name="emailTypeEnumId" type="id-ne"/>
+      <field name="description" type="description"/>
+      <field name="fromDate" type="date-time"/>
+      <field name="thruDate" type="date-time"/>
+      <prim-key field="emailTemplateSettingId"/>
+      <prim-key field="productStoreId"/>
+      <prim-key field="emailTypeEnumId"/>
+      <prim-key field="fromDate"/>
+      <relation type="one" fk-name="PRDSTREMTS_PRDS" rel-entity-name="ProductStore">
+        <key-map field-name="productStoreId"/>
+      </relation>
+      <relation type="one" fk-name="PRDSTREMTS_ETS" rel-entity-name="EmailTemplateSetting">
+        <key-map field-name="emailTemplateSettingId"/>
+      </relation>
+      <relation type="one" fk-name="PRDSTREMTS_ENUM" rel-entity-name="Enumeration">
+        <key-map field-name="emailTypeEnumId" rel-field-name="enumId"/>
+      </relation>
+    </entity>
     <entity entity-name="ProductStoreFinActSetting"
                 package-name="org.ofbiz.product.store"
                 title="Allows financial account, such as gift certificate or calling cards, to be configured at store level">
@@ -3903,7 +3927,7 @@
         <description>Field name on the purchase survey with the send to email address</description>
       </field>
       <field name="purchSurveyCopyMe" type="id">
-        <description>Whether the BCC on ProductStoreEmailSetting should be copied for email notifications</description>
+        <description>Whether the BCC on OldProdStoreEmailSetting should be copied for email notifications</description>
       </field>
       <field name="allowAuthToNegative" type="indicator"></field>
       <field name="minBalance" type="currency-amount"></field>
diff --git a/applications/product/entitydef/entitymodel_view.xml b/applications/product/entitydef/entitymodel_view.xml
index e68629d..b335318 100644
--- a/applications/product/entitydef/entitymodel_view.xml
+++ b/applications/product/entitydef/entitymodel_view.xml
@@ -19,7 +19,7 @@
 -->
 <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
-    
+
     <view-entity entity-name="ContentApprovalProductContentAndInfo"
             package-name="org.ofbiz.content.content"
             title="ContentApproval, ProductContent, Content and DataResource View Entity">
@@ -61,7 +61,7 @@
         <key-map field-name="contentId" rel-field-name="contentIdStart"/>
       </relation>
     </view-entity>
-    
+
     <view-entity entity-name="ProductCategoryMemberAndPrice" package-name="org.ofbiz.product.category" title="ProductCategoryMember And ProductPrice View Entiry">
         <member-entity entity-alias="PCM" entity-name="ProductCategoryMember"/>
         <member-entity entity-alias="PD" entity-name="Product"/>
@@ -80,4 +80,15 @@
             <key-map field-name="productId"/>
         </view-link>
     </view-entity>
+
+    <view-entity entity-name="ProdStoreEmailAndTemplateSettingView" package-name="org.ofbiz.product.store"
+                 title="ProdStoreEmailTplSetting And EmailTemplateSetting View">
+        <member-entity entity-alias="PSES" entity-name="ProdStoreEmailTplSetting"/>
+        <member-entity entity-alias="ETS" entity-name="EmailTemplateSetting"/>
+        <alias-all entity-alias="PSES"/>
+        <alias-all entity-alias="ETS"><exclude field="description"/></alias-all>
+        <view-link entity-alias="PSES" rel-entity-alias="ETS">
+            <key-map field-name="emailTemplateSettingId"/>
+        </view-link>
+    </view-entity>
 </entitymodel>
diff --git a/applications/product/script/org/ofbiz/product/UpgradeServices.xml b/applications/product/script/org/ofbiz/product/UpgradeServices.xml
index ea75b8f..e746ab0 100644
--- a/applications/product/script/org/ofbiz/product/UpgradeServices.xml
+++ b/applications/product/script/org/ofbiz/product/UpgradeServices.xml
@@ -56,6 +56,30 @@
         </iterate>
     </simple-method>
 
+    <simple-method method-name="migrateProductStoreEmailSetting" short-description="Migrate data from OldProductStoreEmailSetting to ProdStoreEmailTplSetting and EmailTemplateSetting">
+        <entity-condition entity-name="ProdStoreEmailTplSetting" list="migrationAlreadyDone"/>
+        <if-not-empty field="migrationAlreadyDone">
+            <add-error><fail-message message="Migrate data already done, nothing to do ! if it's not the case, flush ProdStoreEmailTplSetting entity, check your EmailTemplateSetting and restart this service"/></add-error>
+            <check-errors/>
+        </if-not-empty>
+        <entity-condition entity-name="OldProdStoreEmailSetting" list="oldProductStoreEmailSettings"/>
+        <iterate list="oldProductStoreEmailSettings" entry="oldProductStoreEmailSetting">
+            <make-value value-field="emailTemplateSetting" entity-name="EmailTemplateSetting"/>
+            <sequenced-id sequence-name="EmailTemplateSetting" field="emailTemplateSetting.emailTemplateSettingId"/>
+            <set-nonpk-fields value-field="emailTemplateSetting" map="oldProductStoreEmailSetting"/>
+            <property-to-field resource="ProductUiLabels" property="ProductStoreEmailSettingMigration" field="emailTemplateSetting.description"/>
+            <string-append string=" ${oldProductStoreEmailSetting.productStoreId}" field="emailTemplateSetting.description"/>
+            <make-value value-field="prodStoreEmailTplSetting" entity-name="ProdStoreEmailTplSetting"/>
+            <set field="prodStoreEmailTplSetting.emailTemplateSettingId" from-field="emailTemplateSetting.emailTemplateSettingId"/>
+            <set field="prodStoreEmailTplSetting.productStoreId" from-field="oldProductStoreEmailSetting.productStoreId"/>
+            <set field="prodStoreEmailTplSetting.emailTypeEnumId" from-field="oldProductStoreEmailSetting.emailType"/>
+            <set field="prodStoreEmailTplSetting.fromDate" value="2001-01-01 00:00:00.000" type="Timestamp"/>
+            <field-to-list list="toStore" field="emailTemplateSetting"/>
+            <field-to-list list="toStore" field="prodStoreEmailTplSetting"/>
+        </iterate>
+        <store-list list="toStore"/>
+    </simple-method>
+
      <simple-method method-name="migrateProductKeyword" short-description="Migrate Data From OldProductKeyword To ProductKeyword">
         <entity-condition entity-name="OldProductKeyword" list="oldProductKeywords"/>
         <iterate list="oldProductKeywords" entry="oldProductKeyword">
@@ -74,5 +98,4 @@
             </if-empty>
         </iterate>
     </simple-method>
-
 </simple-methods>
diff --git a/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml b/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml
index 07fc344..75e91b4 100644
--- a/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml
+++ b/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml
@@ -188,14 +188,15 @@
         <remove-value value-field="setting"/>
     </simple-method>
 
-    <!-- ProductStore Email Services -->
+    <!-- ProductStore Email Services-->
+    <!-- deprecated use entity-auto
     <simple-method method-name="createProductStoreEmail" short-description="Create Product Store Email Setting">
         <check-permission permission="CATALOG" action="_CREATE">
             <fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/>
         </check-permission>
         <check-errors/>
 
-        <make-value value-field="newEntity" entity-name="ProductStoreEmailSetting"/>
+        <make-value value-field="newEntity" entity-name="OldProdStoreEmailSetting"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
 
@@ -207,22 +208,24 @@
         </check-permission>
         <check-errors/>
 
-        <make-value value-field="lookupKeyValue" entity-name="ProductStoreEmailSetting"/>
+        <make-value value-field="lookupKeyValue" entity-name="OldProdStoreEmailSetting"/>
         <set-pk-fields map="parameters" value-field="lookupKeyValue"/>
-        <find-by-primary-key entity-name="ProductStoreEmailSetting" map="lookupKeyValue" value-field="lookedUpValue"/>
+        <find-by-primary-key entity-name="OldProdStoreEmailSetting" map="lookupKeyValue" value-field="lookedUpValue"/>
         <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
         <store-value value-field="lookedUpValue"/>
     </simple-method>
+    -->
     <simple-method method-name="removeProductStoreEmail" short-description="Remove Product Store Email Setting">
         <check-permission permission="CATALOG" action="_DELETE">
             <fail-property resource="ProductUiLabels" property="ProductCatalogDeletePermissionError"/>
         </check-permission>
         <check-errors/>
 
-        <make-value value-field="lookupPKMap" entity-name="ProductStoreEmailSetting"/>
+        <make-value value-field="lookupPKMap" entity-name="OldProdStoreEmailSetting"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="ProductStoreEmailSetting" map="lookupPKMap" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
+        <find-by-primary-key entity-name="OldProdStoreEmailSetting" map="lookupPKMap" value-field="lookedUpValue"/>
+        <now-timestamp field="lookedUpValue.thruDate"/>
+        <store-value value-field="lookedUpValue"/>
     </simple-method>
 
     <!-- ProductStore Vendor Payment Services -->
diff --git a/applications/product/servicedef/services_store.xml b/applications/product/servicedef/services_store.xml
index b4527d9..cbb6bd2 100644
--- a/applications/product/servicedef/services_store.xml
+++ b/applications/product/servicedef/services_store.xml
@@ -149,28 +149,43 @@
     </service>
 
     <!-- Product Store Email Services -->
-    <service name="createProductStoreEmailSetting" engine="simple"
-            location="component://product/script/org/ofbiz/product/store/ProductStoreServices.xml" invoke="createProductStoreEmail" auth="true">
+    <service name="createProdStoreEmailTplSetting" engine="entity-auto" invoke="create"
+             auth="true" default-entity-name="ProdStoreEmailTplSetting">
+        <description>Create a Product Store Email Template Setting</description>
+        <required-permissions join-type="AND"><check-permission permission="CATALOG" action="_CREATE"/></required-permissions>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="updateProdStoreEmailTplSetting" engine="entity-auto" invoke="update"
+             auth="true" default-entity-name="ProdStoreEmailTplSetting">
+        <description>Update a Product Store Email Template Setting</description>
+        <required-permissions join-type="AND"><check-permission permission="CATALOG" action="_UPDATE"/></required-permissions>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="removeProdStoreEmailTplSetting" engine="entity-auto" invoke="delete"
+             auth="true" default-entity-name="ProdStoreEmailTplSetting">
+        <description>Remove a Product Store Email Template Setting</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+    <service name="createOldProdStoreEmailSetting" engine="entity-auto" invoke="create"
+             auth="true" default-entity-name="OldProdStoreEmailSetting">
         <description>Create a Product Store Email Setting</description>
-        <auto-attributes entity-name="ProductStoreEmailSetting" include="all" mode="IN" optional="false"/>
-        <override name="xslfoAttachScreenLocation" optional="true"/>
-        <override name="ccAddress" optional="true"/>
-        <override name="bccAddress" optional="true"/>
-        <override name="contentType" optional="true"/>
+        <required-permissions join-type="AND"><check-permission permission="CATALOG" action="_CREATE"/></required-permissions>
+        <auto-attributes entity-name="OldProdStoreEmailSetting" include="pk" mode="IN" optional="false"/>
+        <auto-attributes entity-name="OldProdStoreEmailSetting" include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="updateProductStoreEmailSetting" engine="simple"
-            location="component://product/script/org/ofbiz/product/store/ProductStoreServices.xml" invoke="updateProductStoreEmail" auth="true">
+    <service name="updateOldProdStoreEmailSetting" engine="entity-auto" invoke="update"
+             auth="true" default-entity-name="OldProdStoreEmailSetting">
         <description>Update a Product Store Email Setting</description>
-        <auto-attributes entity-name="ProductStoreEmailSetting" include="all" mode="IN" optional="false"/>
-        <override name="xslfoAttachScreenLocation" optional="true"/>
-        <override name="ccAddress" optional="true"/>
-        <override name="bccAddress" optional="true"/>
-        <override name="contentType" optional="true"/>
+        <required-permissions join-type="AND"><check-permission permission="CATALOG" action="_UPDATE"/></required-permissions>
+        <auto-attributes entity-name="OldProdStoreEmailSetting" include="pk" mode="IN" optional="false"/>
+        <auto-attributes entity-name="OldProdStoreEmailSetting" include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="removeProductStoreEmailSetting" engine="simple"
+    <service name="removeOldProdStoreEmailSetting" engine="simple"
             location="component://product/script/org/ofbiz/product/store/ProductStoreServices.xml" invoke="removeProductStoreEmail" auth="true">
         <description>Remove a Product Store Email Setting</description>
-        <auto-attributes entity-name="ProductStoreEmailSetting" include="pk" mode="IN" optional="false"/>
+        <auto-attributes entity-name="OldProdStoreEmailSetting" include="pk" mode="IN" optional="false"/>
     </service>
 
     <!-- Product Store Shipping Method Services -->
diff --git a/applications/product/servicedef/services_upgrade.xml b/applications/product/servicedef/services_upgrade.xml
index de8f9b1..78469ac 100644
--- a/applications/product/servicedef/services_upgrade.xml
+++ b/applications/product/servicedef/services_upgrade.xml
@@ -41,6 +41,13 @@
             The field Facility.squareFootageSince has been deprecated since revision 929912 (2010-04-01)
         </description>
     </service>
+    <service name="migrateProductStoreEmailSetting" engine="simple"
+            location="component://product/script/org/ofbiz/product/UpgradeServices.xml" invoke="migrateProductStoreEmailSetting">
+        <description>
+            Migrate data from OldProductStoreEmailSetting to ProdStoreEmailTplSetting and EmailTemplateSetting
+            The entity ProductStoreEmailSetting has been deprecated since revision XXX (2011-XX-XX) (FIXME)
+        </description>
+    </service>
     <service name="migrateProductKeyword" engine="simple"
             location="component://product/script/org/ofbiz/product/UpgradeServices.xml" invoke="migrateProductKeyword">
         <description>
@@ -52,5 +59,4 @@
             common/data/CommonTypeData.xml
         </description>
     </service>
-
 </services>
diff --git a/applications/product/src/org/ofbiz/product/product/ProductEvents.java b/applications/product/src/org/ofbiz/product/product/ProductEvents.java
index 13330cb..c21bdaa 100644
--- a/applications/product/src/org/ofbiz/product/product/ProductEvents.java
+++ b/applications/product/src/org/ofbiz/product/product/ProductEvents.java
@@ -1000,7 +1000,7 @@
 
         GenericValue productStoreEmail = null;
         try {
-            productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting",
+            productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting",
                     UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
         } catch (GenericEntityException e) {
             String errMsg = "Unable to get product store email setting for tell-a-friend: " + e.toString();
diff --git a/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java b/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
index 147bc1b..67a29d1 100644
--- a/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
+++ b/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
@@ -1148,13 +1148,13 @@
         }
         GenericValue productStoreEmail = null;
         try {
-            productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", orderHeader.get("productStoreId"), "emailType", "PRDS_ODR_SHIP_COMPLT"));
+            productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", orderHeader.get("productStoreId"), "emailType", "PRDS_ODR_SHIP_COMPLT"));
         } catch (GenericEntityException e) {
-            Debug.logError(e, "Problem getting the ProductStoreEmailSetting for productStoreId =" + orderHeader.get("productStoreId") + " and emailType = PRDS_ODR_SHIP_COMPLT", module);
+            Debug.logError(e, "Problem getting the OldProdStoreEmailSetting for productStoreId =" + orderHeader.get("productStoreId") + " and emailType = PRDS_ODR_SHIP_COMPLT", module);
         }
         if (productStoreEmail == null) {
             return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, 
-                    "ProductProductStoreEmailSettingsNotValid", 
+                    "ProductOldProdStoreEmailSettingsNotValid", 
                     UtilMisc.toMap("productStoreId", orderHeader.get("productStoreId"), 
                             "emailType", "PRDS_ODR_SHIP_COMPLT"), localePar));
         }
@@ -1176,7 +1176,7 @@
         }
         if (UtilValidate.isEmpty(emailString)) {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
-                    "ProductProductStoreEmailSettingsNoSendToFound", localePar));
+                    "ProductOldProdStoreEmailSettingsNoSendToFound", localePar));
         }
 
         Locale locale = PartyWorker.findPartyLastLocale(partyId, delegator);
diff --git a/applications/product/webapp/catalog/WEB-INF/controller.xml b/applications/product/webapp/catalog/WEB-INF/controller.xml
index dff1905..5e8128f 100644
--- a/applications/product/webapp/catalog/WEB-INF/controller.xml
+++ b/applications/product/webapp/catalog/WEB-INF/controller.xml
@@ -2228,22 +2228,44 @@
     </request-map>
     <request-map uri="createProductStoreEmail">
         <security https="true" auth="true"/>
-        <event type="service" path="" invoke="createProductStoreEmailSetting"/>
+        <event type="service" path="" invoke="createProdStoreEmailTplSetting"/>
         <response name="success" type="view" value="EditProductStoreEmails"/>
         <response name="error" type="view" value="EditProductStoreEmails"/>
     </request-map>
     <request-map uri="updateProductStoreEmail">
         <security https="true" auth="true"/>
-        <event type="service" path="" invoke="updateProductStoreEmailSetting"/>
+        <event type="service" path="" invoke="updateProdStoreEmailTplSetting"/>
         <response name="success" type="view" value="EditProductStoreEmails"/>
         <response name="error" type="view" value="EditProductStoreEmails"/>
     </request-map>
     <request-map uri="removeProductStoreEmail">
         <security https="true" auth="true"/>
-        <event type="service" path="" invoke="removeProductStoreEmailSetting"/>
+        <event type="service" path="" invoke="removeProdStoreEmailTplSetting"/>
         <response name="success" type="view" value="EditProductStoreEmails"/>
         <response name="error" type="view" value="EditProductStoreEmails"/>
     </request-map>
+    <request-map uri="EditOldProductStoreEmails">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditOldProductStoreEmails"/>
+    </request-map>
+    <request-map uri="createOldProductStoreEmail">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="createOldProdStoreEmailSetting"/>
+        <response name="success" type="view" value="EditOldProductStoreEmails"/>
+        <response name="error" type="view" value="EditOldProductStoreEmails"/>
+    </request-map>
+    <request-map uri="updateOldProductStoreEmail">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="updateOldProdStoreEmailSetting"/>
+        <response name="success" type="view" value="EditOldProductStoreEmails"/>
+        <response name="error" type="view" value="EditOldProductStoreEmails"/>
+    </request-map>
+    <request-map uri="removeOldProductStoreEmail">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="removeOldProdStoreEmailSetting"/>
+        <response name="success" type="view" value="EditOldProductStoreEmails"/>
+        <response name="error" type="view" value="EditOldProductStoreEmails"/>
+    </request-map>
 
     <!-- ================ Product Store Keyword Override ============= -->
     <request-map uri="editProductStoreKeywordOvrd">
@@ -3161,6 +3183,7 @@
     <view-map name="EditProductStore" type="screen" page="component://product/widget/catalog/StoreScreens.xml#EditProductStore"/>
     <view-map name="FindProductStoreRoles" type="screen" page="component://product/widget/catalog/StoreScreens.xml#FindProductStoreRoles"/>
     <view-map name="EditProductStoreEmails" type="screen" page="component://product/widget/catalog/StoreScreens.xml#EditProductStoreEmails"/>
+    <view-map name="EditOldProductStoreEmails" type="screen" page="component://product/widget/catalog/StoreScreens.xml#EditOldProductStoreEmails"/>
     <view-map name="EditProductStorePromos" type="screen" page="component://product/widget/catalog/StoreScreens.xml#EditProductStorePromos"/>
     <view-map name="EditProductStoreCatalogs" type="screen" page="component://product/widget/catalog/StoreScreens.xml#EditProductStoreCatalogs"/>
     <view-map name="EditProductStoreShipSetup" type="screen" page="component://product/widget/catalog/StoreScreens.xml#EditProductStoreShipSetup"/>
diff --git a/applications/product/widget/catalog/CatalogMenus.xml b/applications/product/widget/catalog/CatalogMenus.xml
index 3bba20a..a27cd98 100644
--- a/applications/product/widget/catalog/CatalogMenus.xml
+++ b/applications/product/widget/catalog/CatalogMenus.xml
@@ -239,6 +239,11 @@
                 <parameter param-name="productStoreId"/>
             </link>
         </menu-item>
+        <menu-item name="EditOldProductStoreEmails" title="${uiLabelMap.ProductOldProductStoreEmails}">
+            <link target="EditOldProductStoreEmails">
+                <parameter param-name="productStoreId"/>
+            </link>
+        </menu-item>
         <menu-item name="EditProductStoreSurveys" title="${uiLabelMap.CommonSurveys}">
             <link target="EditProductStoreSurveys">
                 <parameter param-name="productStoreId"/>
diff --git a/applications/product/widget/catalog/ProductStoreForms.xml b/applications/product/widget/catalog/ProductStoreForms.xml
index 37b8dfa..9d19207 100644
--- a/applications/product/widget/catalog/ProductStoreForms.xml
+++ b/applications/product/widget/catalog/ProductStoreForms.xml
@@ -507,7 +507,48 @@
 
     <form name="createProductStoreEmail" type="single" target="createProductStoreEmail" title=""
         header-row-style="header-row" default-table-style="basic-table">
-        <auto-fields-service service-name="createProductStoreEmailSetting"/>
+        <auto-fields-service service-name="createProdStoreEmailTplSetting"/>
+        <field name="productStoreId" map-name="productStore"><hidden/></field>
+        <field name="emailTypeEnumId" title="${uiLabelMap.CommonEmailType}">
+            <drop-down>
+                <entity-options entity-name="Enumeration" key-field-name="enumId" description="${description}">
+                    <entity-constraint name="enumTypeId" operator="in" value="PRDS_EMAIL,PARTY_EMAIL"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="emailTemplateSettingId"><lookup target-form-name="LookupEmailTemplateSetting"/></field>
+        <field name="fromDate"><date-time default-value="${nowTimestamp}"/></field>
+        <field name="thruDate"><date-time/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="updateProductStoreEmail" type="list" target="updateProductStoreEmail" title="" list-name="productStoreEmailSettings"
+        odd-row-style="alternate-row" default-table-style="basic-table">
+        <auto-fields-service service-name="updateProdStoreEmailTplSetting"/>
+        <auto-fields-entity entity-name="EmailTemplateSetting" default-field-type="display"/>
+        <field name="productStoreId"><hidden/></field>
+        <field name="emailTemplateSettingId">
+            <display-entity entity-name="EmailTemplateSetting" description=" ">
+                <sub-hyperlink target="/content/control/EditEmailTemplateSetting" target-type="inter-app" description="[${emailTemplateSettingId}] ${description}"/>
+            </display-entity>
+        </field>
+        <field name="fromDate"><display type="date"/></field>
+        <field name="emailTypeEnumId" title="${uiLabelMap.CommonEmailType}">
+            <display-entity entity-name="Enumeration" key-field-name="enumId" description="${description}"/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
+            <hyperlink target="removeProductStoreEmail" description="${uiLabelMap.CommonDelete}" also-hidden="false">
+                <parameter param-name="productStoreId"/>
+                <parameter param-name="emailTemplateSettingId"/>
+                <parameter param-name="emailTypeEnumId"/>
+                <parameter param-name="fromDate"/>
+            </hyperlink>
+        </field>
+    </form>
+    <form name="createOldProductStoreEmail" type="single" target="createOldProductStoreEmail" title=""
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createOldProdStoreEmailSetting"/>
         <field name="productStoreId" map-name="productStore"><hidden/></field>
         <field name="emailType" title="${uiLabelMap.CommonEmailType}">
             <drop-down>
@@ -517,22 +558,16 @@
                 </entity-options>
             </drop-down>
         </field>
-        <field name="bodyScreenLocation" title="${uiLabelMap.ProductBodyScreenLocation}"></field>
-        <field name="xslfoAttachScreenLocation" title="${uiLabelMap.ProductAttachmentScreenLocation}"></field>
-        <field name="subject" title="${uiLabelMap.ProductSubject}"></field>
         <field name="fromAddress" title="${uiLabelMap.CommonFromAddress}"></field>
         <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
-    <form name="updateProductStoreEmail" type="list" target="updateProductStoreEmail" title="" list-name="productStoreEmailSettings"
+    <form name="updateOldProductStoreEmail" type="list" target="updateOldProductStoreEmail" title="" list-name="productStoreEmailSettings"
         odd-row-style="alternate-row" default-table-style="basic-table">
-        <auto-fields-service service-name="updateProductStoreEmailSetting"/>
+        <auto-fields-service service-name="updateOldProdStoreEmailSetting"/>
         <field name="productStoreId"><hidden/></field>
         <field name="emailType" title="${uiLabelMap.CommonEmailType}">
             <display-entity entity-name="Enumeration" key-field-name="enumId" description="${description}" cache="true" also-hidden="true"/>
         </field>
-        <field name="bodyScreenLocation" title="${uiLabelMap.ProductBodyScreenLocation}"></field>
-        <field name="xslfoAttachScreenLocation" title="${uiLabelMap.ProductAttachmentScreenLocation}"></field>
-        <field name="subject" title="${uiLabelMap.ProductSubject}"></field>
         <field name="fromAddress" title="${uiLabelMap.CommonFromAddress}"></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
         <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
diff --git a/applications/product/widget/catalog/StoreScreens.xml b/applications/product/widget/catalog/StoreScreens.xml
index cd08dbf..378e5b1 100644
--- a/applications/product/widget/catalog/StoreScreens.xml
+++ b/applications/product/widget/catalog/StoreScreens.xml
@@ -325,7 +325,7 @@
                 <set field="paymentMethodTypeId" from-field="parameters.paymentMethodTypeId"/>
                 <set field="paymentServiceTypeEnumId" from-field="parameters.paymentServiceTypeEnumId"/>
                 <entity-one entity-name="ProductStorePaymentSetting" value-field="productStorePaymentSetting" auto-field-map="true"/>
-                
+
                 <script location="component://product/webapp/catalog/WEB-INF/actions/store/EditProductStorePaySetup.groovy"/>
             </actions>
             <widgets>
@@ -349,20 +349,52 @@
             </widgets>
        </section>
     </screen>
+    <!-- TODO Remove this screen when all send email system will be converted -->
+    <screen name="EditOldProductStoreEmails">
+       <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditProductStoreEmailSetup"/>
+                <set field="headerItem" value="store"/>
+                <set field="tabButtonItem" value="EditOldProductStoreEmails"/>
+                <set field="labelTitleProperty" value="ProductOldProdStoreEmailSettings"/>
+
+                <set field="productStoreId" from-field="parameters.productStoreId"/>
+                <entity-one entity-name="ProductStore" value-field="productStore" auto-field-map="true"/>
+
+                <entity-condition entity-name="OldProdStoreEmailSetting" list="productStoreEmailSettings">
+                    <condition-expr field-name="productStoreId" from-field="productStoreId"/>
+                    <order-by field-name="emailType"/>
+                </entity-condition>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonProductStoreDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <label style="h3">${uiLabelMap.ProductDeprecatedProductStoreEmailScreen}</label>
+                        <screenlet title="${uiLabelMap.PageTitleEditProductStoreEmailSetup}">
+                            <include-form name="updateOldProductStoreEmail" location="component://product/widget/catalog/ProductStoreForms.xml"/>
+                        </screenlet>
+                        <screenlet title="${uiLabelMap.PageTitleAddProductStoreEmailSetup}">
+                            <include-form name="createOldProductStoreEmail" location="component://product/widget/catalog/ProductStoreForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+       </section>
+    </screen>
     <screen name="EditProductStoreEmails">
        <section>
             <actions>
                 <set field="titleProperty" value="PageTitleEditProductStoreEmailSetup"/>
                 <set field="headerItem" value="store"/>
                 <set field="tabButtonItem" value="EditProductStoreEmails"/>
-                <set field="labelTitleProperty" value="ProductProductStoreEmailSettings"/>
+                <set field="labelTitleProperty" value="ProductProdStoreEmailSettings"/>
 
                 <set field="productStoreId" from-field="parameters.productStoreId"/>
                 <entity-one entity-name="ProductStore" value-field="productStore" auto-field-map="true"/>
 
-                <entity-condition entity-name="ProductStoreEmailSetting" list="productStoreEmailSettings">
+                <entity-condition entity-name="ProdStoreEmailAndTemplateSettingView" list="productStoreEmailSettings" filter-by-date="true">
                     <condition-expr field-name="productStoreId" from-field="productStoreId"/>
-                    <order-by field-name="emailType"/>
+                    <order-by field-name="emailTypeEnumId"/>
                 </entity-condition>
             </actions>
             <widgets>
diff --git a/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java b/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java
index 0f53ff5..32342c0 100644
--- a/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java
+++ b/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java
@@ -264,9 +264,9 @@
         // get the ProductStore email settings
         GenericValue productStoreEmail = null;
         try {
-            productStoreEmail = delegator.findOne("ProductStoreEmailSetting", false, "productStoreId", productStoreId, "emailType", "PRDS_PWD_RETRIEVE");
+            productStoreEmail = delegator.findOne("OldProdStoreEmailSetting", false, "productStoreId", productStoreId, "emailType", "PRDS_PWD_RETRIEVE");
         } catch (GenericEntityException e) {
-            Debug.logError(e, "Problem getting ProductStoreEmailSetting", module);
+            Debug.logError(e, "Problem getting OldProdStoreEmailSetting", module);
         }
 
         if (productStoreEmail == null) {
diff --git a/debian/override-data.xslt b/debian/override-data.xslt
index e4999a6..bdc0f25 100644
--- a/debian/override-data.xslt
+++ b/debian/override-data.xslt
@@ -107,7 +107,7 @@
  </xsl:template>
 
  <xsl:template mode="data" match="
-  ProductStoreEmailSetting[
+  OldProdStoreEmailSetting[
    @bccAddress='ofbiztest@example.com' or
    @fromAddress='ofbiztest@example.com']|ContactList[
    @verifyEmailFrom='ofbiztest@example.com'
@@ -123,7 +123,7 @@
   </xsl:element>
  </xsl:template>
 
- <xsl:template mode="match" match="ProductStoreEmailSetting/@bccAddress|ProductStoreEmailSetting/@fromAddress|ProductStoreEmailSetting/@verifyEmailFrom|ContactMech/@infoString|ContactList/@verifyEmailFrom|WorkflowDataField/@initialValue">
+ <xsl:template mode="match" match="OldProdStoreEmailSetting/@bccAddress|OldProdStoreEmailSetting/@fromAddress|OldProdStoreEmailSetting/@verifyEmailFrom|ContactMech/@infoString|ContactList/@verifyEmailFrom|WorkflowDataField/@initialValue">
   <xsl:attribute name="{name()}">
    <xsl:choose>
     <xsl:when test=". = 'ofbiztest@example.com'"><xsl:value-of select="$fromemail"/></xsl:when>
diff --git a/framework/common/config/CommonUiLabels.xml b/framework/common/config/CommonUiLabels.xml
index 273de46..cdeea75 100644
--- a/framework/common/config/CommonUiLabels.xml
+++ b/framework/common/config/CommonUiLabels.xml
@@ -10827,6 +10827,18 @@
         <value xml:lang="es">Comando a llamar</value>
         <value xml:lang="fr">Cmd d'appel</value>
     </property>
+    <property key="FormFieldTitle_bodyScreenLocation">
+        <value xml:lang="de">Body Screen Pfad</value>
+        <value xml:lang="en">Body Screen Location</value>
+        <value xml:lang="es">Ubicación de la Pantalla Principal</value>
+        <value xml:lang="fr">Emplacement de l'écran</value>
+        <value xml:lang="it">Posizione Corpo Videata</value>
+        <value xml:lang="ro">Pozitie Corp Videata</value>
+        <value xml:lang="ru">Путь к экрану содержания</value>
+        <value xml:lang="th">Body Screen Location</value>
+        <value xml:lang="zh">主体屏幕位置</value>
+        <value xml:lang="zh_TW">主體螢幕位置</value>
+    </property>
     <property key="FormFieldTitle_comments">
         <value xml:lang="ar">تعاليق</value>
         <value xml:lang="de">Anmerkungen</value>
@@ -11093,6 +11105,14 @@
         <value xml:lang="es">Código acción dispositivo externo</value>
         <value xml:lang="fr">Obj. de l'action</value>
     </property>
+    <property key="FormFieldTitle_emailTemplateSettingId">
+        <value xml:lang="en">ID email template</value>
+        <value xml:lang="fr">Réf. Modèle mél</value>
+    </property>
+    <property key="FormFieldTitle_fromAddress">
+        <value xml:lang="en">From Address</value>
+        <value xml:lang="fr">Addresse d'envoi</value>
+    </property>
     <property key="FormFieldTitle_fromDate">
         <value xml:lang="ar">تاريخ البدء</value>
         <value xml:lang="de">Von Datum</value>
@@ -11535,6 +11555,18 @@
         <value xml:lang="zh">更新</value>
         <value xml:lang="zh_TW">更新</value>
     </property>
+    <property key="FormFieldTitle_xslfoAttachScreenLocation">
+        <value xml:lang="de">Anhang Screen Pfad (XSL-FO)</value>
+        <value xml:lang="en">Attachment Screen Location (XSL-FO)</value>
+        <value xml:lang="es">Ubicación de la pantalla de Adjuntos (XSL-FO)</value>
+        <value xml:lang="fr">Emplacement de l'écran rattaché (XSL-FO)</value>
+        <value xml:lang="it">Allegato Locazione Videata (XSL-FO)</value>
+        <value xml:lang="ro">Anexa Locatie Videata (XSL-FO)</value>
+        <value xml:lang="ru">Путь к экрану присоединенного файла (XSL-FO)</value>
+        <value xml:lang="th">ที่ตั้งการเชื่อมต่อหน้าจอ (XSL-FO)</value>
+        <value xml:lang="zh">附件屏幕位置 (XSL-FO)</value>
+        <value xml:lang="zh_TW">附件螢幕位置 (XSL-FO)</value>
+    </property>
     <property key="Google Base">
         <value xml:lang="de">Google Base</value>
         <value xml:lang="en">Google Base</value>
@@ -11869,6 +11901,10 @@
         <value xml:lang="zh">登录</value>
         <value xml:lang="zh_TW">登入</value>
     </property>
+    <property key="PageTitleLookupEmailTemplateSetting">
+        <value xml:lang="en">Lookup Email Template Setting</value>
+        <value xml:lang="fr">Recherche d'un modèle de mél</value>
+    </property>
     <property key="PageTitleLookupGeo">
         <value xml:lang="en">Lookup Geo</value>
         <value xml:lang="es">Buscar zonas geográficas</value>
diff --git a/framework/common/config/general.properties b/framework/common/config/general.properties
index 4165d99..c8aaffa 100644
--- a/framework/common/config/general.properties
+++ b/framework/common/config/general.properties
@@ -74,7 +74,7 @@
 # as 'baseUrl' and 'baseSecureUrl' are set in the url.properties file. 
 
 # -- mail notifications enabled (Y|N)
-mail.notifications.enabled=N
+mail.notifications.enabled=Y
 
 # -- redirect all mail notifications to this address for testing
 #mail.notifications.redirectTo=
@@ -104,7 +104,7 @@
 mail.address.caseInsensitive=N
 
 # -- debug SMTP mail option enabled (Y|N)
-mail.debug.on=N
+mail.debug.on=Y
 
 # -- if some addresses fail the SMTP check using the RCPT TO: command then setting this property to false will abort sending the message
 #    to any recipients valid or not
diff --git a/framework/common/script/org/ofbiz/common/email/EmailServices.xml b/framework/common/script/org/ofbiz/common/email/EmailServices.xml
index bdf1e76..0a3961f 100644
--- a/framework/common/script/org/ofbiz/common/email/EmailServices.xml
+++ b/framework/common/script/org/ofbiz/common/email/EmailServices.xml
@@ -24,15 +24,24 @@
         <!-- if partyIdTo provided but no emailAddress, get it from the partyContactMech -->
         <if-empty field="parameters.sendTo">
             <if-empty field="parameters.partyIdTo">
-                <log level="error" message="PartyId or SendTo should be specified!"></log>
+                <log level="error" message="PartyId or SendTo should be specified!"/>
                 <add-error>
                     <fail-property resource="CommonUiLabels" property="CommonEmailShouldBeSpecified"/>
                 </add-error>
             <check-errors/>
             </if-empty>
         </if-empty>
-        <if-not-empty field="parameters.partyIdTo">
+        <if-empty field="parameters.sendTo">
+            <set field="getEmail.partyId" from-field="parameters.partyIdTo"/>
+            <call-service service-name="getPartyEmail" in-map-name="getEmail">
+                <result-to-field result-name="emailAddress" field="parameters.sendTo"/>
+            </call-service>
             <if-empty field="parameters.sendTo">
+                <log level="error" message="PartyId: ${parameters.partyIdTo} has no valid email address!"></log>
+                <add-error>
+                    <fail-property resource="CommonUiLabels" property="CommonEmailNotValid"/>
+                </add-error>
+                <check-errors/>
                 <set field="getEmail.partyId" from-field="parameters.partyIdTo"/>
                 <call-service service-name="getPartyEmail" in-map-name="getEmail">
                     <result-to-field result-name="emailAddress" field="parameters.sendTo"/>
@@ -42,7 +51,7 @@
                     <return/>
                 </if-empty>
             </if-empty>
-        </if-not-empty>
+        </if-empty>
         <entity-one entity-name="EmailTemplateSetting" value-field="emailTemplateSetting"/>
         <if-not-empty field="emailTemplateSetting">
             <set field="emailParams.bodyScreenUri" from-field="emailTemplateSetting.bodyScreenLocation"/>
@@ -51,7 +60,7 @@
             <if-not-empty field="emailTemplateSetting.fromAddress">
                 <set field="emailParams.sendFrom" from-field="emailTemplateSetting.fromAddress"/>
                 <else>
-                    <property-to-field resource="general" property="defaultFromEmailAddress" field="emailParams.sendFrom" default="ofbiztest@example.com"/>                    
+                    <property-to-field resource="general" property="defaultFromEmailAddress" field="emailParams.sendFrom" default="ofbiztest@example.com"/>
                 </else>
             </if-not-empty>
             <set field="emailParams.sendCc" from-field="emailTemplateSetting.ccAddress"/>
@@ -69,7 +78,7 @@
                 <result-to-result result-name="communicationEventId"/>
             </call-service>
             <else>
-                <log level="error" message="sendMailFromTemplateSetting service could not find the emailTemplateSettingId: ${parameters.emailTemplateSettingId}"></log>
+                <log level="error" message="sendMailFromTemplateSetting service could not find the emailTemplateSettingId: ${parameters.emailTemplateSettingId}"/>
             </else>
         </if-not-empty>
     </simple-method>
diff --git a/framework/common/servicedef/services_email.xml b/framework/common/servicedef/services_email.xml
index 1fed6b1..6d9d39c 100644
--- a/framework/common/servicedef/services_email.xml
+++ b/framework/common/servicedef/services_email.xml
@@ -23,6 +23,21 @@
     <description>Content Component Services</description>
     <vendor>OFBiz</vendor>
 
+    <!-- Email Template Setting Management Service -->
+    <service name="createEmailTemplateSetting" engine="entity-auto" invoke="create"
+             auth ="true" default-entity-name="EmailTemplateSetting">
+         <auto-attributes mode="IN" include="nonpk" optional="true"/>
+         <auto-attributes mode="OUT" include="pk"/>
+    </service>
+    <service name="updateEmailTemplateSetting" engine="entity-auto" invoke="update"
+             auth ="true" default-entity-name="EmailTemplateSetting">
+         <auto-attributes mode="IN" include="pk"/>
+         <auto-attributes mode="IN" include="nonpk" optional="true"/>
+    </service>
+    <service name="removeEmailTemplateSetting" engine="entity-auto" invoke="delete"
+             auth ="true" default-entity-name="EmailTemplateSetting">
+         <auto-attributes mode="IN" include="pk"/>
+    </service>
     <!-- Email Related Services -->
     <service name="sendMailInterface" engine="interface" location="" invoke="">
         <description>Interface service for mail services.  contentType defaults to "text/html", sendType defaults to
@@ -35,10 +50,10 @@
         <attribute name="authPass" type="String" mode="IN" optional="true"/>
         <attribute name="port" type="String" mode="IN" optional="true"/>
         <attribute name="sendVia" type="String" mode="IN" optional="true"/>
-        <attribute name="sendType" type="String" mode="IN" optional="true"/>        
+        <attribute name="sendType" type="String" mode="IN" optional="true"/> 
         <attribute name="socketFactoryClass" type="String" mode="IN" optional="true"/>
         <attribute name="socketFactoryPort" type="String" mode="IN" optional="true"/>
-        <attribute name="socketFactoryFallback" type="String" mode="IN" optional="true"/>        
+        <attribute name="socketFactoryFallback" type="String" mode="IN" optional="true"/>
         <attribute name="sendFailureNotification" mode="IN" type="Boolean" optional="true"/>
         <attribute name="sendPartial" mode="IN" type="Boolean" optional="true"/>
         <attribute name="subject" type="String" mode="INOUT" optional="true" allow-html="safe"/>
@@ -50,14 +65,14 @@
         <attribute name="custRequestId" type="String" mode="INOUT" optional="true"/>
         <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/><!-- mail can be disabled in general.properties so no output -->
         <!--  used for parsing and ECAs -->
-        <attribute name="communicationEventId" type="String" mode="INOUT" optional="true"/>        
+        <attribute name="communicationEventId" type="String" mode="INOUT" optional="true"/>
     </service>
     <service name="sendMail" engine="java"
             location="org.ofbiz.common.email.EmailServices" invoke="sendMail">
         <description>Send E-Mail Service.  partyId and communicationEventId aren't used by sendMail
             but are passed down to storeEmailAsCommunication during the SECA chain.  See sendMailInterface for more comments.</description>
         <implements service="sendMailInterface"/>
-        <attribute name="body" type="String" mode="INOUT" optional="false" allow-html="safe"/>        
+        <attribute name="body" type="String" mode="INOUT" optional="false" allow-html="safe"/>
         <override name="contentType" mode="INOUT"/>
         <override name="subject" mode="INOUT" optional="false"/>
         <override name="emailType" type="String" mode="INOUT" optional="true"/>
@@ -94,16 +109,13 @@
         <attribute name="subject" type="String" mode="OUT" optional="true"/>
         <attribute name="body" type="String" mode="OUT" optional="false"/>
     </service>
-    <service name="sendMailFromTemplateSetting" engine="simple"
+    <service name="sendMailFromTemplateSetting" engine="simple" max-retry="3"
         location="component://common/script/org/ofbiz/common/email/EmailServices.xml" invoke="sendMailFromTemplateSetting">
         <description>Send Email From Email Template Setting Service</description>
-        <implements service="sendMailInterface"/>
+        <implements service="sendMailFromScreen"/>
         <attribute name="emailTemplateSettingId" type="String" mode="IN" optional="false"/>
         <attribute name="partyIdTo" type="String" mode="IN" optional="true"/>
-        <attribute name="bodyText" type="String" mode="IN" optional="true" allow-html="safe"/>
         <attribute name="attachmentName" type="String" mode="IN" optional="true"/>
-        <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/>
-        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
         <attribute name="body" type="String" mode="OUT" optional="true"/>
     </service>
 
diff --git a/framework/common/webcommon/WEB-INF/common-controller.xml b/framework/common/webcommon/WEB-INF/common-controller.xml
index 3314f7a..dbd3ed4 100644
--- a/framework/common/webcommon/WEB-INF/common-controller.xml
+++ b/framework/common/webcommon/WEB-INF/common-controller.xml
@@ -204,8 +204,9 @@
     <!-- Lookup requests -->
     <request-map uri="LookupGeo"><security https="true" auth="true"/><response name="success" type="view" value="LookupGeo"/></request-map>
     <request-map uri="LookupGeoName"><security https="true" auth="true"/><response name="success" type="view" value="LookupGeoName"/></request-map>
+    <request-map uri="LookupEmailTemplateSetting"><security https="true" auth="true"/><response name="success" type="view" value="LookupEmailTemplateSetting"/></request-map>
     <request-map uri="LookupLocale"><security https="true" auth="true"/><response name="success" type="view" value="LookupLocale"/></request-map>
-    
+
     <!--========================== AJAX events =====================-->
     <!-- Get states related to a country -->
     <request-map uri="getAssociatedStateList">
@@ -277,5 +278,6 @@
     
     <view-map name="LookupGeo" type="screen" page="component://common/widget/LookupScreens.xml#LookupGeo"/>
     <view-map name="LookupGeoName" type="screen" page="component://common/widget/LookupScreens.xml#LookupGeoName"/>
+    <view-map name="LookupEmailTemplateSetting" type="screen" page="component://common/widget/LookupScreens.xml#LookupEmailTemplateSetting"/>
     <view-map name="LookupLocale" type="screen" page="component://common/widget/LookupScreens.xml#LookupLocale"/>
 </site-conf>
diff --git a/framework/common/widget/LookupForms.xml b/framework/common/widget/LookupForms.xml
index 4b4137c..1706f8c 100644
--- a/framework/common/widget/LookupForms.xml
+++ b/framework/common/widget/LookupForms.xml
@@ -115,6 +115,27 @@
         </field>
     </form>
 
+    <form name="LookupEmailTemplateSetting" type="single" target="LookupEmailTemplateSetting">
+        <auto-fields-entity entity-name="EmailTemplateSetting" default-field-type="find"/>
+        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
+    </form>
+
+    <form name="ListEmailTemplateSettings" type="list" list-name="listIt" paginate-target="LookupEmailTemplateSetting"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <actions>
+            <service service-name="performFind" result-map="result" result-map-list="listIt">
+                <field-map field-name="inputFields" from-field="parameters"/>
+                <field-map field-name="orderBy" value="emailTemplateSettingId"/>
+                <field-map field-name="entityName" value="EmailTemplateSetting"/>
+            </service>
+        </actions>
+        <auto-fields-entity entity-name="EmailTemplateSetting" default-field-type="display"/>
+        <field name="emailTemplateSettingId" widget-style="smallSubmit">
+            <hyperlink also-hidden="false" target-type="plain" description="${description} [${emailTemplateSettingId}]" target="javascript:set_value('${emailTemplateSettingId}')"/>
+        </field>
+    </form>
+
     <form name="LookupLocale" type="single" target="LookupLocale">
         <field name="localeString"><text-find/></field>
         <field name="localeName" title="${uiLabelMap.CommonLanguageTitle}"><text-find/></field>
diff --git a/framework/common/widget/LookupScreens.xml b/framework/common/widget/LookupScreens.xml
index efb37c9..a6920d2 100644
--- a/framework/common/widget/LookupScreens.xml
+++ b/framework/common/widget/LookupScreens.xml
@@ -73,7 +73,7 @@
                 <!-- required: fields to search a match -->
                 <!-- the first element from searchFields is returned after user selection --> 
                 <!-- it might be hidden based on widget.autocompleter.displayReturnField property in widget.properties -->                
-                <set field="searchFields" value="[geoName, geoId, geoCode]"/>                
+                <set field="searchFields" value="[geoName, geoId, geoCode]"/>
 
                 <!-- optional: fields to display in the given order, default is searchFields -->
                 <set field="displayFields" value="[geoId, geoName, geoCode]"/>
@@ -226,6 +226,24 @@
         </section>
     </screen>
 
+    <screen name="LookupEmailTemplateSetting">
+        <section>
+            <actions>
+                <set field="title" value="${uiLabelMap.PageTitleLookupEmailTemplateSetting}"/>
+            </actions>
+            <widgets>
+               <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="search-options">
+                        <include-form name="LookupEmailTemplateSetting" location="component://common/widget/LookupForms.xml"/>
+                    </decorator-section>
+                    <decorator-section name="search-results">
+                        <include-form name="ListEmailTemplateSettings" location="component://common/widget/LookupForms.xml"/>
+                    </decorator-section>
+              </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="LookupLocale">
         <section>
             <actions>
diff --git a/specialpurpose/ebaystore/data/DemoEbayStoreData.xml b/specialpurpose/ebaystore/data/DemoEbayStoreData.xml
index 0c56a67..177a498 100644
--- a/specialpurpose/ebaystore/data/DemoEbayStoreData.xml
+++ b/specialpurpose/ebaystore/data/DemoEbayStoreData.xml
@@ -94,10 +94,10 @@
     <Content contentId="EBAY_ITEM_DISPATCH1" contentTypeId="DOCUMENT" dataResourceId="EBAY_ITEM_DISPATCH1" statusId="CTNT_IN_PROGRESS"/>
     <ContentRole contentId="EBAY_ITEM_DISPATCH1" partyId="DemoEbayAccount1" roleTypeId="OWNER" fromDate="2010-01-01 00:00:00.000"/>
 
-    <ProductStoreEmailSetting productStoreId="90101" emailType="EBAY_WIN_BUYER_NOTI" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#WinnigBuyerNotification" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Winnig Buyer Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
-    <ProductStoreEmailSetting productStoreId="90101" emailType="EBAY_PAY_RECIEVED" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#PaymentRecieved" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - PaymentRecieved #${buyerUserId}" xslfoAttachScreenLocation=""/>
-    <ProductStoreEmailSetting productStoreId="90101" emailType="EBAY_FEEBACK_REMIN" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#FeedbackReminder" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Feedback Reminder #${buyerUserId}" xslfoAttachScreenLocation=""/>
-    <ProductStoreEmailSetting productStoreId="90101" emailType="EBAY_ITEM_DISPATCH" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#EbayEmailTemplate" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Item Dispatched Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90101" emailType="EBAY_WIN_BUYER_NOTI" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#WinnigBuyerNotification" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Winnig Buyer Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90101" emailType="EBAY_PAY_RECIEVED" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#PaymentRecieved" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - PaymentRecieved #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90101" emailType="EBAY_FEEBACK_REMIN" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#FeedbackReminder" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Feedback Reminder #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90101" emailType="EBAY_ITEM_DISPATCH" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#EbayEmailTemplate" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Item Dispatched Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
 
     <!-- ===================== -->
     <!-- Ebay Store Demo2 Data -->
@@ -174,8 +174,8 @@
     <Content contentId="EBAY_ITEM_DISPATCH2" contentTypeId="DOCUMENT" dataResourceId="EBAY_ITEM_DISPATCH2" statusId="CTNT_IN_PROGRESS"/>
     <ContentRole contentId="EBAY_ITEM_DISPATCH2" partyId="DemoEbayAccount2" roleTypeId="OWNER" fromDate="2010-01-01 00:00:00.000"/>
 
-    <ProductStoreEmailSetting productStoreId="90102" emailType="EBAY_WIN_BUYER_NOTI" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#WinnigBuyerNotification" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Winnig Buyer Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
-    <ProductStoreEmailSetting productStoreId="90102" emailType="EBAY_PAY_RECIEVED" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#PaymentRecieved" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - PaymentRecieved #${buyerUserId}" xslfoAttachScreenLocation=""/>
-    <ProductStoreEmailSetting productStoreId="90102" emailType="EBAY_FEEBACK_REMIN" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#FeedbackReminder" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Feedback Reminder #${buyerUserId}" xslfoAttachScreenLocation=""/>
-    <ProductStoreEmailSetting productStoreId="90102" emailType="EBAY_ITEM_DISPATCH" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#EbayEmailTemplate" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Item Dispatched Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90102" emailType="EBAY_WIN_BUYER_NOTI" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#WinnigBuyerNotification" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Winnig Buyer Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90102" emailType="EBAY_PAY_RECIEVED" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#PaymentRecieved" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - PaymentRecieved #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90102" emailType="EBAY_FEEBACK_REMIN" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#FeedbackReminder" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Feedback Reminder #${buyerUserId}" xslfoAttachScreenLocation=""/>
+    <OldProdStoreEmailSetting productStoreId="90102" emailType="EBAY_ITEM_DISPATCH" bccAddress="ofbiztest@example.com" bodyScreenLocation="component://ebaystore/widget/EbayEmailScreens.xml#EbayEmailTemplate" fromAddress="ofbiztest@example.com" subject="OFBiz Demo - Item Dispatched Notification #${buyerUserId}" xslfoAttachScreenLocation=""/>
 </entity-engine-xml>
diff --git a/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml b/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml
index c9f0f39..b81e5ca 100644
--- a/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml
+++ b/specialpurpose/ebaystore/script/org/ofbiz/ebaystore/EbayStoreEvents.xml
@@ -264,15 +264,15 @@
             <result-to-field result-name="contentId"/>
         </call-service>
         
-        <!-- create ProductStoreEmailSetting -->
+        <!-- create OldProdStoreEmailSetting -->
         <if-not-empty field="parameters.includePayment">
             <set field="parameters.subject" value="${parameters.subject} INCLUDE_PAYMENT"/>
         </if-not-empty>
         <if-not-empty field="parameters.includeCrossPromotions">
             <set field="parameters.subject" value="${parameters.includeCrossPromotions} INCLUDE_CROSS_PROMOTIONS"/>
         </if-not-empty>
-        <set-service-fields service-name="createProductStoreEmailSetting" to-map="newEmailSetting" map="parameters"/>
-        <call-service service-name="createProductStoreEmailSetting" in-map-name="newEmailSetting" >
+        <set-service-fields service-name="createOldProdStoreEmailSetting" to-map="newEmailSetting" map="parameters"/>
+        <call-service service-name="createOldProdStoreEmailSetting" in-map-name="newEmailSetting" >
             <result-to-field result-name="contentId"/>
         </call-service>
     </simple-method>
@@ -284,15 +284,15 @@
             <result-to-field result-name="dataResourceId" field="parameters.dataResourceId"/>
         </call-service>
 
-        <!-- update ProductStoreEmailSetting -->
+        <!-- update OldProdStoreEmailSetting -->
         <!--if-not-empty field="parameters.includePayment">
             <set field="parameters.subject" value="${parameters.subject} INCLUDE_PAYMENT"/>
         </if-not-empty>
         <if-not-empty field="parameters.includeCrossPromotions">
             <set field="parameters.subject" value="${parameters.subject} INCLUDE_CROSS_PROMOTIONS"/>
         </if-not-empty-->
-        <set-service-fields service-name="updateProductStoreEmailSetting" to-map="updateEmailSetting" map="parameters"/>
-        <call-service service-name="updateProductStoreEmailSetting" in-map-name="updateEmailSetting" >
+        <set-service-fields service-name="updateOldProdStoreEmailSetting" to-map="updateEmailSetting" map="parameters"/>
+        <call-service service-name="updateOldProdStoreEmailSetting" in-map-name="updateEmailSetting" >
             <result-to-field result-name="contentId"/>
         </call-service>
     </simple-method>
diff --git a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
index 80ed12c..49cdcfc 100644
--- a/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
+++ b/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
@@ -353,7 +353,7 @@
                         for (SellingManagerSoldOrderType item : items) {
                             // call send
                             Map<String, Object> sendMap = FastMap.newInstance();
-                            GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_FEEBACK_REMIN"));
+                            GenericValue productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_FEEBACK_REMIN"));
                             String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                             sendMap.put("bodyScreenUri", bodyScreenLocation);
                             String subjectString = productStoreEmail.getString("subject");
@@ -687,7 +687,7 @@
                         for (SellingManagerSoldOrderType item : items) {
                             // call send
                             Map<String, Object> sendMap = FastMap.newInstance();
-                            GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_PAY_RECIEVED"));
+                            GenericValue productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_PAY_RECIEVED"));
                             String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                             sendMap.put("bodyScreenUri", bodyScreenLocation);
                             String subjectString = productStoreEmail.getString("subject");
@@ -941,7 +941,7 @@
                                 String buyerUserId = bidder.get("userId").toString();
 
                                 Map<String, Object> sendMap = FastMap.newInstance();
-                                GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_WIN_BUYER_NOTI"));
+                                GenericValue productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_WIN_BUYER_NOTI"));
                                 String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                                 sendMap.put("bodyScreenUri", bodyScreenLocation);
                                 String subjectString = productStoreEmail.getString("subject");
@@ -1001,7 +1001,7 @@
                         String buyerEmail = item.get("buyerEmail").toString();
 
                          Map<String, Object> sendMap = FastMap.newInstance();
-                         GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_ITEM_DISPATCH"));
+                         GenericValue productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_ITEM_DISPATCH"));
                          String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                          sendMap.put("bodyScreenUri", bodyScreenLocation);
                          String subjectString = productStoreEmail.getString("subject");
diff --git a/specialpurpose/ebaystore/widget/EbayEmailScreens.xml b/specialpurpose/ebaystore/widget/EbayEmailScreens.xml
index 38e12a0..71fbcee 100644
--- a/specialpurpose/ebaystore/widget/EbayEmailScreens.xml
+++ b/specialpurpose/ebaystore/widget/EbayEmailScreens.xml
@@ -30,7 +30,7 @@
                 </service>
                 <set field="userLoginId" from-field="result.userLoginId"/>
                 <set field="emailType" from-field="parameters.emailType"/>
-                <entity-one value-field="emailSetting" entity-name="ProductStoreEmailSetting">
+                <entity-one value-field="emailSetting" entity-name="OldProdStoreEmailSetting">
                     <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                     <field-map field-name="emailType" from-field="emailType"/>
                 </entity-one>
diff --git a/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml b/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml
index 8c28224..bf118bd 100644
--- a/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml
+++ b/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml
@@ -407,7 +407,7 @@
                 </service>
                 <set field="userLoginId" from-field="result.userLoginId"/>
                 <set field="emailType" from-field="parameters.emailType"/>
-                <entity-one value-field="emailSetting" entity-name="ProductStoreEmailSetting">
+                <entity-one value-field="emailSetting" entity-name="OldProdStoreEmailSetting">
                     <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                     <field-map field-name="emailType" from-field="emailType"/>
                 </entity-one>
diff --git a/specialpurpose/ecommerce/data/DemoProduct.xml b/specialpurpose/ecommerce/data/DemoProduct.xml
index a697a6b..b702d34 100644
--- a/specialpurpose/ecommerce/data/DemoProduct.xml
+++ b/specialpurpose/ecommerce/data/DemoProduct.xml
@@ -97,37 +97,37 @@
     <ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="EXT_COD" paymentServiceTypeEnumId="PRDS_PAY_EXTERNAL" paymentService="" paymentCustomMethodId=""/>
     <ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="EXT_BILLACT" paymentServiceTypeEnumId="PRDS_PAY_EXTERNAL" paymentService="" paymentCustomMethodId=""/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_CONFIRM" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNotice" xslfoAttachScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNoticePdf" subject="OFBiz Demo - Order Confirmation #${orderId}" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderCompleteNotice" subject="OFBiz Demo - Your Order Is Complete #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_BACKORDER" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#BackorderNotice" subject="OFBiz Demo - Backorder Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_CHANGE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderChangeNotice" subject="OFBiz Demo - Order Change Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_PAYRETRY" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#PaymentRetryNotice" subject="OFBiz Demo - Order Payment Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_SHIP_COMPLT" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#ShipmentCompleteNotice" subject="OFBiz Demo - Shipment Complete Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_CONFIRM" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNotice" xslfoAttachScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNoticePdf" subject="OFBiz Demo - Order Confirmation #${orderId}" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderCompleteNotice" subject="OFBiz Demo - Your Order Is Complete #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_BACKORDER" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#BackorderNotice" subject="OFBiz Demo - Backorder Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_CHANGE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderChangeNotice" subject="OFBiz Demo - Order Change Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_PAYRETRY" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#PaymentRetryNotice" subject="OFBiz Demo - Order Payment Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_ODR_SHIP_COMPLT" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#ShipmentCompleteNotice" subject="OFBiz Demo - Shipment Complete Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_RTN_ACCEPT" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnAccept" subject="OFBiz Demo - Return Accepted #${returnHeader.returnId}" xslfoAttachScreenLocation="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_RTN_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnComplete" subject="OFBiz Demo - Return Completed #${returnHeader.returnId}" xslfoAttachScreenLocation="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_RTN_CANCEL" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnCancel" subject="OFBiz Demo - Return Cancelled #${returnHeader.returnId}" xslfoAttachScreenLocation="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_RTN_ACCEPT" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnAccept" subject="OFBiz Demo - Return Accepted #${returnHeader.returnId}" xslfoAttachScreenLocation="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_RTN_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnComplete" subject="OFBiz Demo - Return Completed #${returnHeader.returnId}" xslfoAttachScreenLocation="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_RTN_CANCEL" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnCancel" subject="OFBiz Demo - Return Cancelled #${returnHeader.returnId}" xslfoAttachScreenLocation="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_GC_PURCHASE" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardPurchase" fromAddress="ofbiztest@example.com" subject="A Gift From ${senderName}!"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_GC_RELOAD" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardReload" fromAddress="ofbiztest@example.com" subject="Gift Card Reload Results"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_GC_PURCHASE" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardPurchase" fromAddress="ofbiztest@example.com" subject="A Gift From ${senderName}!"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_GC_RELOAD" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardReload" fromAddress="ofbiztest@example.com" subject="Gift Card Reload Results"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_TELL_FRIEND" bodyScreenLocation="component://ecommerce/widget/EmailProductScreens.xml#TellFriend" subject="${sendFrom} has sent you a link!" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_TELL_FRIEND" bodyScreenLocation="component://ecommerce/widget/EmailProductScreens.xml#TellFriend" subject="${sendFrom} has sent you a link!" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_PWD_RETRIEVE" bodyScreenLocation="component://securityext/widget/EmailSecurityScreens.xml#PasswordEmail" subject="OFBiz Demo - Password Reminder (${userLogin.userLoginId})" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_PWD_RETRIEVE" bodyScreenLocation="component://securityext/widget/EmailSecurityScreens.xml#PasswordEmail" subject="OFBiz Demo - Password Reminder (${userLogin.userLoginId})" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_QUO_CONFIRM" bodyScreenLocation="component://order/widget/ordermgr/QuoteScreens.xml#ViewQuoteSimple" xslfoAttachScreenLocation="component://order/widget/ordermgr/QuoteScreens.xml#QuoteReport" subject="OFBiz Demo - Quote Confirmation #${quoteId}" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_QUO_CONFIRM" bodyScreenLocation="component://order/widget/ordermgr/QuoteScreens.xml#ViewQuoteSimple" xslfoAttachScreenLocation="component://order/widget/ordermgr/QuoteScreens.xml#QuoteReport" subject="OFBiz Demo - Quote Confirmation #${quoteId}" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PARTY_REGIS_CONFIRM" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#CreatePartyNotification" subject="New Account Created" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_REGISTER" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#CreatePartyNotification" subject="New Account Created" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="UPD_PRSNL_INF_CNFRM" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#ChangePersonalInfoNotification" subject="Personal Information Updated" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_EMAIL_VERIFY" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#VerifyEmailAddressNotification" subject="Email Address Verification" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PARTY_REGIS_CONFIRM" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#CreatePartyNotification" subject="New Account Created" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_REGISTER" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#CreatePartyNotification" subject="New Account Created" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="UPD_PRSNL_INF_CNFRM" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#ChangePersonalInfoNotification" subject="Personal Information Updated" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="PRDS_EMAIL_VERIFY" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#VerifyEmailAddressNotification" subject="Email Address Verification" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="9000" emailType="CONT_NOTI_EMAIL" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactUsEmailNotification" subject="Contact-us Information Notification" fromAddress="ofbiztest@example.com" />
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="CONT_NOTI_EMAIL" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactUsEmailNotification" subject="Contact-us Information Notification" fromAddress="ofbiztest@example.com" />
     
-    <ProductStoreEmailSetting productStoreId="9000" emailType="SUB_CONT_LIST_NOTI" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListSubscribeEmail" subject="Subscribe Contact List" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="UNSUB_CONT_LIST_VERI" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListUnsubscribeVerifyEmail" subject="Verify Unsubscribe Contact List" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="UNSUB_CONT_LIST_NOTI" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListUnsubscribeEmail" subject="Unsubscribe Contact List" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="9000" emailType="CONT_EMAIL_TEMPLATE" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListEmailTemplate"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="SUB_CONT_LIST_NOTI" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListSubscribeEmail" subject="Subscribe Contact List" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="UNSUB_CONT_LIST_VERI" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListUnsubscribeVerifyEmail" subject="Verify Unsubscribe Contact List" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="UNSUB_CONT_LIST_NOTI" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListUnsubscribeEmail" subject="Unsubscribe Contact List" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="9000" emailType="CONT_EMAIL_TEMPLATE" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListEmailTemplate"/>
 
     <WebAnalyticsConfig webSiteId="WebStore" webAnalyticsTypeId="GOOGLE_ANALYTICS" webAnalyticsCode="--  enter here your analytic script code --"/>
     <WebAnalyticsConfig webSiteId="WebStore" webAnalyticsTypeId="BING_ANALYTICS" webAnalyticsCode="--  enter here your analytic script code --"/>
diff --git a/specialpurpose/ecommerce/data/DemoRentalProduct.xml b/specialpurpose/ecommerce/data/DemoRentalProduct.xml
index 9056e35..f514bcf 100644
--- a/specialpurpose/ecommerce/data/DemoRentalProduct.xml
+++ b/specialpurpose/ecommerce/data/DemoRentalProduct.xml
@@ -45,22 +45,22 @@
     <ProductStorePaymentSetting productStoreId="RentalStore" paymentMethodTypeId="EXT_PAYPAL" paymentServiceTypeEnumId="PRDS_PAY_EXTERNAL" paymentService="" paymentCustomMethodId="" paymentGatewayConfigId="PAYPAL_CONFIG"/>
     <ProductStorePaymentSetting productStoreId="RentalStore" paymentMethodTypeId="EXT_WORLDPAY" paymentServiceTypeEnumId="PRDS_PAY_EXTERNAL" paymentService="" paymentCustomMethodId="" paymentGatewayConfigId="WORLDPAY_CONFIG"/>
 
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_CONFIRM" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNotice" xslfoAttachScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNoticePdf" subject="OFBiz Demo - Order Confirmation #${orderId}" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderCompleteNotice" subject="OFBiz Demo - Your Order Is Complete #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_BACKORDER" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#BackorderNotice" subject="OFBiz Demo - Backorder Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_CHANGE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderChangeNotice" subject="OFBiz Demo - Order Change Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_PAYRETRY" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#PaymentRetryNotice" subject="OFBiz Demo - Order Payment Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_CONFIRM" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNotice" xslfoAttachScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderConfirmNoticePdf" subject="OFBiz Demo - Order Confirmation #${orderId}" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderCompleteNotice" subject="OFBiz Demo - Your Order Is Complete #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_BACKORDER" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#BackorderNotice" subject="OFBiz Demo - Backorder Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_CHANGE" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#OrderChangeNotice" subject="OFBiz Demo - Order Change Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_ODR_PAYRETRY" bodyScreenLocation="component://ecommerce/widget/EmailOrderScreens.xml#PaymentRetryNotice" subject="OFBiz Demo - Order Payment Notification #${orderId}" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_RTN_ACCEPT" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnAccept" subject="OFBiz Demo - Return Accepted #${returnHeader.returnId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_RTN_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnComplete" subject="OFBiz Demo - Return Completed #${returnHeader.returnId}" fromAddress="ofbiztest@example.com"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_RTN_CANCEL" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnCancel" subject="OFBiz Demo - Return Cancelled #${returnHeader.returnId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_RTN_ACCEPT" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnAccept" subject="OFBiz Demo - Return Accepted #${returnHeader.returnId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_RTN_COMPLETE" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnComplete" subject="OFBiz Demo - Return Completed #${returnHeader.returnId}" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_RTN_CANCEL" bodyScreenLocation="component://ecommerce/widget/EmailReturnScreens.xml#ReturnCancel" subject="OFBiz Demo - Return Cancelled #${returnHeader.returnId}" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_GC_PURCHASE" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardPurchase" fromAddress="ofbiztest@example.com" subject="A Gift From ${senderName}!"/>
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_GC_RELOAD" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardReload" fromAddress="ofbiztest@example.com" subject="Gift Card Reload Results"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_GC_PURCHASE" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardPurchase" fromAddress="ofbiztest@example.com" subject="A Gift From ${senderName}!"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_GC_RELOAD" bodyScreenLocation="component://ecommerce/widget/EmailGiftCardScreens.xml#GiftCardReload" fromAddress="ofbiztest@example.com" subject="Gift Card Reload Results"/>
 
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_TELL_FRIEND" bodyScreenLocation="component://ecommerce/widget/EmailProductScreens.xml#TellFriend" subject="${sendFrom} has sent you a link!" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_TELL_FRIEND" bodyScreenLocation="component://ecommerce/widget/EmailProductScreens.xml#TellFriend" subject="${sendFrom} has sent you a link!" fromAddress="ofbiztest@example.com"/>
 
-    <ProductStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_PWD_RETRIEVE" bodyScreenLocation="component://securityext/widget/EmailSecurityScreens.xml#PasswordEmail" subject="OFBiz Demo - Password Reminder (${userLoginId})" fromAddress="ofbiztest@example.com"/>
+    <OldProdStoreEmailSetting productStoreId="RentalStore" emailType="PRDS_PWD_RETRIEVE" bodyScreenLocation="component://securityext/widget/EmailSecurityScreens.xml#PasswordEmail" subject="OFBiz Demo - Password Reminder (${userLoginId})" fromAddress="ofbiztest@example.com"/>
 
     <ProductStoreFacility productStoreId="RentalStore" facilityId="WebStoreWarehouse" fromDate="2001-05-13 12:00:00.0"/>
     <ProductStoreRole partyId="admin" roleTypeId="SALES_REP" productStoreId="RentalStore" fromDate="2001-05-13 12:00:00.0"/>
diff --git a/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml b/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
index 256fa25..8060b4b 100644
--- a/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
+++ b/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
@@ -419,7 +419,7 @@
         <if-not-empty field="emailContext.emailAddress">
             <set from-field="parameters.emailProductStoreId" field="storeEmailLookup.productStoreId"/>
             <set value="PRDS_CUST_REGISTER" field="storeEmailLookup.emailType"/>
-            <find-by-primary-key map="storeEmailLookup" entity-name="ProductStoreEmailSetting"  value-field="storeEmail"/>
+            <find-by-primary-key map="storeEmailLookup" entity-name="OldProdStoreEmailSetting"  value-field="storeEmail"/>
             <if-not-empty field="storeEmail.bodyScreenLocation">
                 <get-related-one value-field="createdUserLogin" relation-name="Person" to-value-field="person"/>
                 <set field="bodyParameters.person" from-field="person"/>
diff --git a/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy b/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy
index b2aea57..b6b1664 100644
--- a/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy
+++ b/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy
@@ -147,7 +147,7 @@
         }
     }
 
-    webSiteId = orderHeader.webSiteId ?: CatalogWorker.getWebSiteId(request);
+    webSiteId = orderHeader.webSiteId ?: CatalogWorker.getStoreCatalogs(delegator, orderHeader.productStoreId);
 
     payToPartyId = productStore.payToPartyId;
     paymentAddress =  PaymentWorker.getPaymentAddress(delegator, payToPartyId);
diff --git a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
index 28e55ad..4b808ee 100644
--- a/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
+++ b/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
@@ -253,7 +253,7 @@
 
                 if (UtilValidate.isNotEmpty(sendToEmail)) {
                     String productStoreId = UtilProperties.getPropertyValue("oagis.properties", "Oagis.Warehouse.SyncInventoryProductStoreId");
-                    GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "PRDS_OAGIS_CONFIRM"));
+                    GenericValue productStoreEmail = delegator.findByPrimaryKey("OldProdStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "PRDS_OAGIS_CONFIRM"));
                     if (productStoreEmail != null) {
                         String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                         sendMap.put("bodyScreenUri", bodyScreenLocation);