You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2020/08/27 18:37:29 UTC

[ofbiz-framework] branch trunk updated: Fixed: MessagingException in sendShipmentScheduledNotification service (OFBIZ-11984)

This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8487df8  Fixed: MessagingException in sendShipmentScheduledNotification service (OFBIZ-11984)
8487df8 is described below

commit 8487df866662e5a27445b7647b437b21a3d14492
Author: Mridul Pathak <mr...@apache.org>
AuthorDate: Thu Aug 27 23:58:27 2020 +0530

    Fixed: MessagingException in sendShipmentScheduledNotification service (OFBIZ-11984)
    
    The sendFrom emailAddress had the unnecessary comma prefix. The sendTo emailAddress list was a list of lists instead of list of strings.
    Also affected sendOrderDeliveryScheduleNotification minilang service. <string-append> tag was used with comma prefix for sendFrom emailAddress, since the sender would only be one used <set> tag without any prefix instead.
---
 applications/order/minilang/order/OrderDeliveryServices.xml      | 2 +-
 .../product/groovyScripts/shipment/ShipmentServices.groovy       | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/applications/order/minilang/order/OrderDeliveryServices.xml b/applications/order/minilang/order/OrderDeliveryServices.xml
index c2e04f1..90c384d 100644
--- a/applications/order/minilang/order/OrderDeliveryServices.xml
+++ b/applications/order/minilang/order/OrderDeliveryServices.xml
@@ -88,7 +88,7 @@ under the License.
         <set field="curUserPcmFindMap.contactMechTypeId" value="EMAIL_ADDRESS"/>
         <find-by-and entity-name="PartyAndContactMech" map="curUserPcmFindMap" list="curUserPartyAndContactMechs"/>
         <first-from-list list="curUserPartyAndContactMechs" entry="curUserPartyAndContactMech"/>
-        <string-append field="sendEmailMap.sendFrom" string="${curUserPartyAndContactMech.infoString}" prefix=","/>
+        <set field="sendEmailMap.sendFrom" from-field="curUserPartyAndContactMech.infoString"/>
 
         <!-- find email addresses of all parties in SHIPMENT_CLERK roleTypeId, set as sendTo -->
         <set value="SHIPMENT_CLERK" field="shipmentClerkFindMap.roleTypeId"/>
diff --git a/applications/product/groovyScripts/shipment/ShipmentServices.groovy b/applications/product/groovyScripts/shipment/ShipmentServices.groovy
index 6b6f7d9..bd7e71a 100644
--- a/applications/product/groovyScripts/shipment/ShipmentServices.groovy
+++ b/applications/product/groovyScripts/shipment/ShipmentServices.groovy
@@ -448,7 +448,7 @@ def sendShipmentScheduledNotification() {
             .where(partyId: userLogin.partyId,
                     contactMechTypeId: "EMAIL_ADDRESS")
             .queryFirst()
-    Map sendEmailMap = [sendFrom: ("," + curUserPartyAndContactMech.infoString)]
+    Map sendEmailMap = [sendFrom: curUserPartyAndContactMech.infoString]
 
     // find email addresses of partyIdFrom, set as sendTo
     Map sendToPartyIdMap = [:]
@@ -467,12 +467,15 @@ def sendShipmentScheduledNotification() {
     // go through all send to parties and get email addresses
     List sendTos = []
     for (Map.Entry entry : sendToPartyIdMap) {
-        sendTos << from("PartyAndContactMech")
+        List sendToPartyAndContactMechs = from("PartyAndContactMech")
                 .where(partyId: entry.getKey(),
                         contactMechTypeId: "EMAIL_ADDRESS")
                 .getFieldList("infoString")
+        sendToPartyAndContactMechs.each {
+            sendTos << it
+        }
     }
-    sendEmailMap.sendTo = sendTos.join(',')
+    sendEmailMap.sendTo = sendTos.join(",")
 
     // set subject, contentType, templateName, templateData
     sendEmailMap.subject = "Scheduled Notification for Shipment " + shipment.shipmentId