← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16533: Test email, minor

 

------------------------------------------------------------
revno: 16533
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-08-27 11:49:23 +0200
message:
  Test email, minor
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/email/DefaultEmailService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/email/DefaultEmailService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/email/DefaultEmailService.java	2014-08-27 09:30:03 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/email/DefaultEmailService.java	2014-08-27 09:49:23 +0000
@@ -47,6 +47,7 @@
 {
     private static final String TEST_EMAIL_SUBJECT = "Test email from DHIS 2";
     private static final String TEST_EMAIL_TEXT = "This is an automatically generated email from ";
+    private static final String TEST_DEFAULT_SENDER = "DHIS 2";
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -101,7 +102,8 @@
     @Override
     public void sendTestEmail( )
     {
-        String instanceName = StringUtils.trimToEmpty( (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_APPLICATION_TITLE ) );
+        String instanceName = StringUtils.defaultIfBlank( (String) systemSettingManager.getSystemSetting( 
+            SystemSettingManager.KEY_APPLICATION_TITLE ), TEST_DEFAULT_SENDER );
         
         sendEmail( TEST_EMAIL_SUBJECT, TEST_EMAIL_TEXT + instanceName, null, currentUserService.getCurrentUser(), true );
     }