Email notifications added for New Account creation and Account Information Updated. Sumit, Ashish, Thanks for the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@556116 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Anil Patel
2007-07-13 19:32:04 +00:00
parent c61e2af27d
commit 55e2a13518
8 changed files with 183 additions and 5 deletions
@@ -87,6 +87,8 @@ under the License.
<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@yahoo.com" fromAddress="ofbiztest@yahoo.com"/>
<ProductStoreEmailSetting productStoreId="9000" emailType="PARTY_REGIS_CONFIRM" bodyScreenLocation="component://party/widget/partymgr/PartyEmailNotification.xml#CreatePartyNotification" subject="New Account Created" bccAddress="ofbiztest@yahoo.com" fromAddress="ofbiztest@yahoo.com"/>
<ProductStoreEmailSetting productStoreId="9000" emailType="UPD_PRSNL_INF_CNFRM" bodyScreenLocation="component://party/widget/partymgr/PartyEmailNotification.xml#ChangePersonalInfoNotification" subject="Personal Information Updated" bccAddress="ofbiztest@yahoo.com" fromAddress="ofbiztest@yahoo.com"/>
<ProductStoreFacility productStoreId="9000" facilityId="WebStoreWarehouse" fromDate="2001-05-13 12:00:00.0"/>
<ProductStoreRole partyId="admin" roleTypeId="SALES_REP" productStoreId="9000" fromDate="2001-05-13 12:00:00.0"/>
@@ -135,6 +135,10 @@ under the License.
<Enumeration description="Private Tenant" enumCode="PVT_TENANT" enumId="PRESS_PVT_TENANT" sequenceId="02" enumTypeId="PTY_RESID_STTS"/>
<Enumeration description="Public Tenant" enumCode="PUB_TENANT" enumId="PRESS_PUB_TENANT" sequenceId="03" enumTypeId="PTY_RESID_STTS"/>
<Enumeration description="With Parents" enumCode="PARENTS" enumId="PRESS_PARENTS" sequenceId="04" enumTypeId="PTY_RESID_STTS"/>
<EnumerationType description="Party Email Notification" enumTypeId="PARTY_EMAIL" hasTable="N" parentTypeId=""/>
<Enumeration description="Party Registration Confirmation Mail" enumCode="REGIS_CONFIRM" enumId="PARTY_REGIS_CONFIRM" sequenceId="01" enumTypeId="PARTY_EMAIL"/>
<Enumeration description="Update Personal Info Confirmation" enumCode="UPDAT_CONFIRM" enumId="UPD_PRSNL_INF_CNFRM" sequenceId="02" enumTypeId="PARTY_EMAIL"/>
<!-- top level role types -->
<RoleType description="Administrator" hasTable="N" parentTypeId="" roleTypeId="ADMIN"/>
@@ -26,11 +26,9 @@ under the License.
<set field="require_login" value="true" />
<!-- this parameter must be set to true or the createUser method below will use a default password instead of the one entered by user -->
<set field="create_allow_password" value="true" />
<set field="parameters.roleTypeId" value="CUSTOMER" />
<call-simple-method method-name="createUser"/>
</simple-method>
<simple-method method-name="createProspect" short-description="Create Prospect" login-required="false">
<set field="require_email" value="true" />
<set field="require_phone" value="false" />
@@ -392,9 +390,68 @@ under the License.
<set field="emailPurposeContext.contactMechPurposeTypeId" value="PRIMARY_EMAIL" />
<call-service service-name="createPartyContactMechPurpose" in-map-name="emailPurposeContext"/>
</if-not-empty>
<!-- set the partyId in the request -->
<field-to-request field-name="partyId" map-name="tempMap" request-name="partyId"/>
<!--send New User Email Notification-->
<map-to-map map-name="parameters" to-map-name="bodyParameters"/>
<entity-condition entity-name="ProductStoreEmailSetting" list-name="productStoreEmailSettings">
<condition-list>
<condition-expr field-name="emailType" operator="equals" value="PARTY_REGIS_CONFIRM"/>
</condition-list>
</entity-condition>
<first-from-list entry-name="storeEmail" list-name="productStoreEmailSettings"/>
<if-not-empty field-name="bodyScreenLocation" map-name="storeEmail">
<set field="emailParams.sendTo" from-field="parameters.USER_EMAIL"/>
<set field="emailParams.subject" from-field="storeEmail.subject"/>
<set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/>
<set field="emailParams.sendCc" from-field="storeEmail.ccAddress"/>
<set field="emailParams.sendBcc" from-field="storeEmail.bccAddress"/>
<set field="emailParams.contentType" from-field="storeEmail.contentType"/>
<set field="emailParams.bodyParameters" from-field="bodyParameters"/>
<set field="emailParams.bodyScreenUri" from-field="storeEmail.bodyScreenLocation"/>
<map-to-map to-map-name="emailParams.bodyParameters" map-name="parameters"/>
<call-service service-name="sendMailFromScreen" in-map-name="emailParams"/>
</if-not-empty>
</simple-method>
<!--send personal information update email notification-->
<simple-method method-name="sendUpdatePersonalInfoEmailNotification" short-description="Send the Notification email on personal information updation" login-required="false">
<map-to-map map-name="parameters" to-map-name="bodyParameters"/>
<set field="bodyParameters.userLoginId" from-field="parameters.userLoginId"/>
<entity-condition entity-name="ProductStoreEmailSetting" list-name="productStoreEmailSettings">
<condition-list>
<condition-expr field-name="emailType" operator="equals" value="UPD_PRSNL_INF_CNFRM"/>
</condition-list>
</entity-condition>
<first-from-list entry-name="storeEmail" list-name="productStoreEmailSettings"/>
<if-not-empty field-name="bodyScreenLocation" map-name="storeEmail">
<if-not-empty field-name="parameters.partyId">
<set field="partyId" from-field="parameters.partyId"/>
<else>
<set field="partyId" from-field="parameters.updatedUserLogin.partyId"/>
</else>
</if-not-empty>
<entity-condition entity-name="PartyContactDetailByPurpose" list-name="partyContactDetailByPurposes">
<condition-list>
<condition-expr field-name="contactMechPurposeTypeId" operator="equals" value="PRIMARY_EMAIL"/>
<condition-expr field-name="partyId" operator="equals" env-name="partyId"/>
</condition-list>
</entity-condition>
<filter-list-by-date list-name="partyContactDetailByPurposes" to-list-name="validPartyContactDetailByPurposes"/>
<first-from-list entry-name="partyContactDetailByPurpose" list-name="validPartyContactDetailByPurposes"/>
<entity-one entity-name="PartyAndPerson" value-name="partyAndPerson"/>
<set field="bodyParameters.partyAndPerson" from-field="partyAndPerson"/>
<set field="contactMechId" from-field="partyContactDetailByPurpose.contactMechId"/>
<entity-one entity-name="ContactMech" value-name="contactMech"/>
<set field="emailParams.sendTo" from-field="contactMech.infoString"/>
<set field="emailParams.subject" from-field="storeEmail.subject"/>
<set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/>
<set field="emailParams.sendCc" from-field="storeEmail.ccAddress"/>
<set field="emailParams.sendBcc" from-field="storeEmail.bccAddress"/>
<set field="emailParams.contentType" from-field="storeEmail.contentType"/>
<set field="emailParams.bodyParameters" from-field="bodyParameters"/>
<set field="emailParams.bodyScreenUri" from-field="storeEmail.bodyScreenLocation"/>
<call-service service-name="sendMailFromScreen" in-map-name="emailParams"/>
</if-not-empty>
</simple-method>
</simple-methods>
+7 -1
View File
@@ -78,5 +78,11 @@ under the License.
<eca service="sendEmailToContactList" event="commit">
<action service="setCommEventComplete" mode="sync"/>
</eca>
<eca service="updatePassword" event="commit">
<action service="sendUpdatePersonalInfoEmailNotification" mode="sync"/>
</eca>
<eca service="updatePerson" event="commit">
<action service="sendUpdatePersonalInfoEmailNotification" mode="sync"/>
</eca>
</service-eca>
+5 -1
View File
@@ -102,7 +102,6 @@ under the License.
<attribute name="preferredCurrencyUomId" type="String" mode="IN" optional="true"/>
<attribute name="description" type="String" mode="IN" optional="true"/>
</service>
<service name="createPartyGroup" engine="java" default-entity-name="PartyGroup"
location="org.ofbiz.party.party.PartyServices" invoke="createPartyGroup" auth="false">
<description>Create a PartyGroup</description>
@@ -755,4 +754,9 @@ under the License.
<auto-attributes mode="IN" include="pk" optional="false"/>
<auto-attributes mode="IN" include="nonpk" optional="true"/>
</service>
<service name="sendUpdatePersonalInfoEmailNotification" engine="simple"
location="org/ofbiz/party/user/UserEvents.xml" invoke="sendUpdatePersonalInfoEmailNotification" auth="false">
<attribute name="partyId" type="String" mode="IN" optional="false"/>
</service>
</services>
@@ -0,0 +1,31 @@
<#--
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.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>${title}</title>
<link rel="stylesheet" href="${baseUrl}/images/maincss.css" type="text/css"/>
</head>
<body>
<div class="head1">${title}</div>
<p class="tabletext">Hello ${parameters.partyAndPerson.salutation?if_exists} ${parameters.partyAndPerson.personalTitle?if_exists} ${parameters.partyAndPerson.firstName?if_exists} ${parameters.partyAndPerson.middleName?if_exists} ${parameters.partyAndPerson.lastName?if_exists} ${parameters.partyAndPerson.suffix?if_exists},</b></p>
<p class="tabletext">Your personal information has been updated successfully.</p>
</body>
</html>
@@ -0,0 +1,31 @@
<#--
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.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>${title}</title>
<link rel="stylesheet" href="${baseUrl}/images/maincss.css" type="text/css"/>
</head>
<body>
<div class="head1">${title}</div>
<p class="tabletext">Hello ${parameters.USER_TITLE?if_exists} ${parameters.USER_FIRST_NAME?if_exists} ${parameters.USER_MIDDLE_NAME?if_exists} ${parameters.USER_LAST_NAME?if_exists} ${parameters.USER_SUFFIX?if_exists},</p>
<p class="tabletext">Your account has been created.</p>
</body>
</html>
@@ -0,0 +1,43 @@
<?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.
-->
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="CreatePartyNotification">
<section>
<actions>
<set field="title" value="Party Account Creation Notification Mail"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://party/templates/email/CreatePartyNotification.ftl"/></html></platform-specific>
</widgets>
</section>
</screen>
<screen name="ChangePersonalInfoNotification">
<section>
<actions>
<set field="title" value="Change Personal Info Notification Mail"/>
</actions>
<widgets>
<platform-specific><html><html-template location="component://party/templates/email/ChangePersonalInfoNotification.ftl"/></html></platform-specific>
</widgets>
</section>
</screen>
</screens>