svn commit: r774217 - in /ofbiz/trunk/framework/common: script/org/ofbiz/common/email/EmailServices.xml src/org/ofbiz/common/email/EmailServices.java

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

svn commit: r774217 - in /ofbiz/trunk/framework/common: script/org/ofbiz/common/email/EmailServices.xml src/org/ofbiz/common/email/EmailServices.java

jaz-3
Author: jaz
Date: Wed May 13 05:51:45 2009
New Revision: 774217

URL: http://svn.apache.org/viewvc?rev=774217&view=rev
Log:
sendMail service now uses the FlexibleStringExpander to expand subject/body; communication event ID is added to the bodyParamters for the other mail services

Modified:
    ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml
    ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java

Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml?rev=774217&r1=774216&r2=774217&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml Wed May 13 05:51:45 2009
@@ -34,6 +34,7 @@
         <if-not-empty field="emailTemplateSetting">
             <set field="emailParams.bodyScreenUri" from-field="emailTemplateSetting.bodyScreenLocation"/>
             <set field="emailParams.xslfoAttachScreenLocation" from-field="emailTemplateSetting.xslfoAttachScreenLocation"/>
+            <set field="emailParams.partyId" from-field="parameters.partyIdTo"/>
             <set field="emailParams.sendFrom" from-field="emailTemplateSetting.fromAddress"/>
             <set field="emailParams.sendCc" from-field="emailTemplateSetting.ccAddress"/>
             <set field="emailParams.sendBcc" from-field="emailTemplateSetting.bccAddress"/>

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java?rev=774217&r1=774216&r2=774217&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java Wed May 13 05:51:45 2009
@@ -99,6 +99,8 @@
         }
         Map<String, Object> results = ServiceUtil.returnSuccess();
         String subject = (String) context.get("subject");
+        subject = FlexibleStringExpander.expandString(subject, context);
+        
         String partyId = (String) context.get("partyId");
         String body = (String) context.get("body");
         List<Map<String, Object>> bodyParts = UtilGenerics.checkList(context.get("bodyParts"));
@@ -108,6 +110,7 @@
         results.put("partyId", partyId);
         results.put("subject", subject);
         if (UtilValidate.isNotEmpty(body)) {
+            body = FlexibleStringExpander.expandString(body, context);
             results.put("body", body);
         }
         if (UtilValidate.isNotEmpty(bodyParts)) {
@@ -385,6 +388,7 @@
         if (partyId == null) {
             partyId = (String) bodyParameters.get("partyId");
         }
+        bodyParameters.put("communicationEventId", serviceContext.get("communicationEventId"));
         if (UtilValidate.isNotEmpty(webSiteId)) {
             NotificationServices.setBaseUrl(dctx.getDelegator(), webSiteId, bodyParameters);
         }
@@ -515,6 +519,7 @@
         // also expand the subject at this point, just in case it has the FlexibleStringExpander syntax in it...
         String subject = (String) serviceContext.remove("subject");
         subject = FlexibleStringExpander.expandString(subject, screenContext, locale);
+        Debug.logInfo("Expanded email subject to: " + subject, module);
         serviceContext.put("subject", subject);
         serviceContext.put("partyId", partyId);