Author: sichen
Date: Thu Jan  4 14:31:51 2007
New Revision: 492782

URL: http://svn.apache.org/viewvc?view=rev&rev=492782
Log:
a couple of email to contact list improvements: skip the 
storeEmailAsCommunication service if there is a communicationEventId w/ a SECA 
condition, and avoid storing of email when the contact list is a NEWSLETTER

Modified:
    ofbiz/trunk/applications/content/servicedef/secas.xml
    
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Modified: ofbiz/trunk/applications/content/servicedef/secas.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/secas.xml?view=diff&rev=492782&r1=492781&r2=492782
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/secas.xml Thu Jan  4 14:31:51 
2007
@@ -27,9 +27,11 @@
         <action service="createSurveyQuestionAppl" mode="sync"/>
     </eca>
     
-     <eca service="sendMail" event="commit">
-       <condition field-name="partyId" operator="is-not-empty"/>
-       <action service="storeEmailAsCommunication" mode="sync"/>
+    <!-- emails should not be stored as new communication event if there is no 
partyId or if it is already a commevent being sent out -->
+    <eca service="sendMail" event="commit">
+        <condition field-name="partyId" operator="is-not-empty"/>
+        <condition field-name="communicationEventId" operator="is-empty"/>
+        <action service="storeEmailAsCommunication" mode="sync"/>
     </eca>
-    
+
 </service-eca>

Modified: 
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?view=diff&rev=492782&r1=492781&r2=492782
==============================================================================
--- 
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
 (original)
+++ 
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
 Thu Jan  4 14:31:51 2007
@@ -208,8 +208,9 @@
                     
                     sendMailParams.put("sendTo", emailAddress);
                     sendMailParams.put("partyId", partyId);
-                    
-                    if (! 
contactList.getString("contactListTypeId").equals("NEWSLETTER")) {
+                   
+                    // if it is a NEWSLETTER then we do not want the outgoing 
emails stored, so put a communicationEventId in the sendMail context to prevent 
storeEmailAsCommunicationEvent from running
+                    if 
("NEWSLETTER".equals(contactList.getString("contactListTypeId"))) {
                         sendMailParams.put("communicationEventId", 
communicationEventId);
                     }
                     


Reply via email to