Author: deepak
Date: Thu Mar 9 09:13:22 2017
New Revision: 1786116
URL:
http://svn.apache.org/viewvc?rev=1786116&view=revLog:
Improved: Remove unnecessary cc and bcc , Applied slightly modified patch from jira issue.
(OFBIZ-9231)
Thanks Suraj Khurana for your contribution.
Modified:
ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
Modified: ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java?rev=1786116&r1=1786115&r2=1786116&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java Thu Mar 9 09:13:22 2017
@@ -137,8 +137,12 @@ public class EmailServices {
// check to see if we should redirect all mail for testing
String redirectAddress = EntityUtilProperties.getPropertyValue("general", "mail.notifications.redirectTo", delegator);
if (UtilValidate.isNotEmpty(redirectAddress)) {
- String originalRecipients = " [To: " + sendTo + ", Cc: " + sendCc + ", Bcc: " + sendBcc + "]";
- subject += originalRecipients;
+ StringBuilder sb = new StringBuilder();
+ sb.append(" [To: ").append(sendTo);
+ if (UtilValidate.isNotEmpty(sendCc)) sb.append(", Cc: ").append(sendCc);
+ if (UtilValidate.isNotEmpty(sendBcc)) sb.append(", Bcc: ").append(sendBcc);
+ sb.append("]");
+ subject += sb.toString();
sendTo = redirectAddress;
sendCc = null;
sendBcc = null;