Author: surajk
Date: Sat Mar 30 06:29:01 2019
New Revision: 1856603

URL: http://svn.apache.org/viewvc?rev=1856603&view=rev
Log:
Improved: Send Email services should be called asynchronously. Checked it and 
not getting any error as mentioned in previous comment.
(OFBIZ-10860)

Modified:
    
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java

Modified: 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java?rev=1856603&r1=1856602&r2=1856603&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java
 Sat Mar 30 06:29:01 2019
@@ -915,15 +915,8 @@ public class GiftCertificateServices {
                 emailCtx.put("sendBcc", bcc);
                 emailCtx.put("subject", 
productStoreEmail.getString("subject"));
                 emailCtx.put("userLogin", userLogin);
-                
-                // send off the email async so we will retry on failed attempts
-                // SC 20060405: Changed to runSync because runAsync kept 
getting an error:
-                // Problem serializing service attributes (Cannot serialize 
object of class java.util.PropertyResourceBundle)
                 try {
-                    Map<String, Object> serviceResults = 
dispatcher.runSync("sendMailFromScreen", emailCtx);
-                    if (ServiceUtil.isError(serviceResults)) {
-                        return 
ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResults));
-                    }
+                    dispatcher.runAsync("sendMailFromScreen", emailCtx);
                 } catch (GenericServiceException e) {
                     Debug.logError(e, "Problem sending mail", module);
                     // this is fatal; we will rollback and try again later
@@ -933,7 +926,6 @@ public class GiftCertificateServices {
                 }
             }
         }
-
         return ServiceUtil.returnSuccess();
     }
 


Reply via email to