Author: apatel
Date: Fri Jul 13 12:32:04 2007 New Revision: 556116 URL: http://svn.apache.org/viewvc?view=rev&rev=556116 Log: Email notifications added for New Account creation and Account Information Updated. Sumit, Ashish, Thanks for the patch. Added: ofbiz/trunk/applications/party/templates/ ofbiz/trunk/applications/party/templates/email/ ofbiz/trunk/applications/party/templates/email/ChangePersonalInfoNotification.ftl ofbiz/trunk/applications/party/templates/email/CreatePartyNotification.ftl ofbiz/trunk/applications/party/widget/partymgr/PartyEmailNotification.xml Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml ofbiz/trunk/applications/party/data/PartyTypeData.xml ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml ofbiz/trunk/applications/party/servicedef/secas.xml ofbiz/trunk/applications/party/servicedef/services.xml Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml?view=diff&rev=556116&r1=556115&r2=556116 ============================================================================== --- ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml (original) +++ ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml Fri Jul 13 12:32:04 2007 @@ -87,6 +87,8 @@ <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="[hidden email]" fromAddress="[hidden email]"/> + <ProductStoreEmailSetting productStoreId="9000" emailType="PARTY_REGIS_CONFIRM" bodyScreenLocation="component://party/widget/partymgr/PartyEmailNotification.xml#CreatePartyNotification" subject="New Account Created" bccAddress="[hidden email]" fromAddress="[hidden email]"/> + <ProductStoreEmailSetting productStoreId="9000" emailType="UPD_PRSNL_INF_CNFRM" bodyScreenLocation="component://party/widget/partymgr/PartyEmailNotification.xml#ChangePersonalInfoNotification" subject="Personal Information Updated" bccAddress="[hidden email]" fromAddress="[hidden email]"/> <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"/> Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?view=diff&rev=556116&r1=556115&r2=556116 ============================================================================== --- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original) +++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Fri Jul 13 12:32:04 2007 @@ -135,6 +135,10 @@ <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"/> Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml?view=diff&rev=556116&r1=556115&r2=556116 ============================================================================== --- ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml (original) +++ ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml Fri Jul 13 12:32:04 2007 @@ -26,11 +26,9 @@ <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 @@ <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> Modified: ofbiz/trunk/applications/party/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/secas.xml?view=diff&rev=556116&r1=556115&r2=556116 ============================================================================== --- ofbiz/trunk/applications/party/servicedef/secas.xml (original) +++ ofbiz/trunk/applications/party/servicedef/secas.xml Fri Jul 13 12:32:04 2007 @@ -78,5 +78,11 @@ <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> Modified: ofbiz/trunk/applications/party/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?view=diff&rev=556116&r1=556115&r2=556116 ============================================================================== --- ofbiz/trunk/applications/party/servicedef/services.xml (original) +++ ofbiz/trunk/applications/party/servicedef/services.xml Fri Jul 13 12:32:04 2007 @@ -102,7 +102,6 @@ <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> @@ -754,5 +753,10 @@ <description>Update a PartyCarrierAccount record</description> <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> Added: ofbiz/trunk/applications/party/templates/email/ChangePersonalInfoNotification.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/templates/email/ChangePersonalInfoNotification.ftl?view=auto&rev=556116 ============================================================================== --- ofbiz/trunk/applications/party/templates/email/ChangePersonalInfoNotification.ftl (added) +++ ofbiz/trunk/applications/party/templates/email/ChangePersonalInfoNotification.ftl Fri Jul 13 12:32:04 2007 @@ -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> Added: ofbiz/trunk/applications/party/templates/email/CreatePartyNotification.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/templates/email/CreatePartyNotification.ftl?view=auto&rev=556116 ============================================================================== --- ofbiz/trunk/applications/party/templates/email/CreatePartyNotification.ftl (added) +++ ofbiz/trunk/applications/party/templates/email/CreatePartyNotification.ftl Fri Jul 13 12:32:04 2007 @@ -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> Added: ofbiz/trunk/applications/party/widget/partymgr/PartyEmailNotification.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyEmailNotification.xml?view=auto&rev=556116 ============================================================================== --- ofbiz/trunk/applications/party/widget/partymgr/PartyEmailNotification.xml (added) +++ ofbiz/trunk/applications/party/widget/partymgr/PartyEmailNotification.xml Fri Jul 13 12:32:04 2007 @@ -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> |
Free forum by Nabble | Edit this page |