svn commit: r556520 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/user/UserEvents.xml servicedef/services.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r556520 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/user/UserEvents.xml servicedef/services.xml

apatel-2
Author: apatel
Date: Sun Jul 15 23:37:08 2007
New Revision: 556520

URL: http://svn.apache.org/viewvc?view=rev&rev=556520
Log:
cleaned up code for sending email when new user is created.

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml
    ofbiz/trunk/applications/party/servicedef/services.xml

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=556520&r1=556519&r2=556520
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/user/UserEvents.xml Sun Jul 15 23:37:08 2007
@@ -287,7 +287,7 @@
         <set field="partyDataSource.isCreate" value="Y" />
         <!-- get the visit from the session to get the visitId -->
         <session-to-field field-name="visit"/>
- <set from-field="visit.visitId" field="partyDataSource.visitId"/>
+        <set from-field="visit.visitId" field="partyDataSource.visitId"/>
 
         <!-- now that everything is validated & setup, check to see if there are errors, then call the services -->
         <check-errors/>
@@ -394,6 +394,11 @@
         <field-to-request field-name="partyId" map-name="tempMap" request-name="partyId"/>
 
         <!--send New User Email Notification-->
+        <call-simple-method method-name="sendCreatePartyEmailNotification"/>
+    </simple-method>
+
+    <!--send party creation email notification-->
+    <simple-method method-name="sendCreatePartyEmailNotification" short-description="Notification email on party creation" login-required="false">
         <map-to-map map-name="parameters" to-map-name="bodyParameters"/>    
         <entity-condition entity-name="ProductStoreEmailSetting" list-name="productStoreEmailSettings">
             <condition-list>
@@ -402,7 +407,13 @@
         </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"/>
+            <if-not-empty field-name="parameters.USER_EMAIL">
+                <set field="sendToEmailAdd" from-field="parameters.USER_EMAIL"/>
+            <else>
+                <set field="sendToEmailAdd" from-field="parameters.emailAddress"/>
+            </else>            
+            </if-not-empty>
+            <set field="emailParams.sendTo" from-field="sendToEmailAdd"/>
             <set field="emailParams.subject" from-field="storeEmail.subject"/>
             <set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/>
             <set field="emailParams.sendCc" from-field="storeEmail.ccAddress"/>
@@ -413,11 +424,11 @@
             <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>
+    </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"/>
@@ -425,10 +436,10 @@
         </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>
+            <if-not-empty field-name="parameters.updatedUserLogin.partyId">
                 <set field="partyId" from-field="parameters.updatedUserLogin.partyId"/>
+            <else>
+                <set field="partyId" from-field="parameters.partyId"/>
             </else>
             </if-not-empty>
             <entity-condition entity-name="PartyContactDetailByPurpose" list-name="partyContactDetailByPurposes">

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?view=diff&rev=556520&r1=556519&r2=556520
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Sun Jul 15 23:37:08 2007
@@ -764,6 +764,11 @@
 
     <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"/>
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="updatedUserLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>    
+    </service>
+    <service name="sendCreatePartyEmailNotification" engine="simple"
+            location="org/ofbiz/party/user/UserEvents.xml" invoke="sendCreatePartyEmailNotification" auth="false">
+        <attribute name="USER_EMAIL" type="String" mode="IN" optional="false"/>
     </service>
 </services>