Scarab commit: svn commit: r10932 - trunk/src/java/org/tigris/scarab/services/email/TemplateHtmlEmail.java

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2010-02-27 15:50:55-0800
New Revision: 10932

Modified:
   trunk/src/java/org/tigris/scarab/services/email/TemplateHtmlEmail.java

Log:
- Added IssueIdCount to Send Log-messages
- Added "cc" receivers to send Log-messages
- Fixed a typo in the logmessages where "cc" receivers where reported as "to" receivers.

Modified: trunk/src/java/org/tigris/scarab/services/email/TemplateHtmlEmail.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/services/email/TemplateHtmlEmail.java?view=diff&pathrev=10932&r1=10931&r2=10932
==============================================================================
--- trunk/src/java/org/tigris/scarab/services/email/TemplateHtmlEmail.java	(original)
+++ trunk/src/java/org/tigris/scarab/services/email/TemplateHtmlEmail.java	2010-02-27 15:50:55-0800
@@ -323,28 +323,29 @@
 
     private void logSend()
     {
+        // Retrieve the IssueId if available:
+        String issueId = getIssueDisplayString();
+
         InternetAddress from = this.getFromAddress();
+
         Iterator<InternetAddress> toIter = this.toList.iterator();
         while(toIter.hasNext())
         {
             InternetAddress to = toIter.next();
-            emailLog.info("from:"+from.getAddress() + " - to:"+to.getAddress() + " - OK");
+            emailLog.info(issueId + "from:"+from.getAddress() + " - to:"+to.getAddress() + " - OK");
+        }
+        Iterator<InternetAddress> ccIter = this.ccList.iterator();        
+        while(ccIter.hasNext())
+        {
+            InternetAddress cc = ccIter.next();
+            emailLog.error(issueId + "from:"+from.getAddress() + " - cc:"+cc.getAddress() + " - OK");
         }
     }
     
     private void logFail(Exception e)
     {
         // Retrieve the IssueId if available:
-        Issue issue = (Issue) context.get("issue");
-        String issueId;
-        if( issue != null)
-        {
-            issueId = "issue:"+issue.getIdPrefix() + issue.getIdCount()+" ";
-        }
-        else
-        {
-            issueId = "";
-        }
+        String issueId = getIssueDisplayString();
         
         InternetAddress from = this.getFromAddress();
         
@@ -359,10 +360,25 @@
         while(ccIter.hasNext())
         {
             InternetAddress cc = ccIter.next();
-            emailLog.error(issueId + "from:"+from.getAddress() + " - to:"+cc.getAddress() + " - FAIL (" + e.getMessage()+")");
+            emailLog.error(issueId + "from:"+from.getAddress() + " - cc:"+cc.getAddress() + " - FAIL (" + e.getMessage()+")");
         }
         
     }
+
+    private String getIssueDisplayString() 
+    {
+        Issue issue = (Issue) context.get("issue");
+        String issueId;
+        if( issue != null)
+        {
+            issueId = "issue:"+issue.getIdPrefix() + issue.getIdCount()+" ";
+        }
+        else
+        {
+            issueId = "";
+        }
+        return issueId;
+    }
     
     private void dumpContextToLog(Exception e) 
     {

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2452994
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.