NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/statistics/StatisticsEmailAdapter.java
/**
     * Sets email configuration values
     * 
     * @return Map contains dynamic values to be replaced with place holders in Email Template at runtime
     */
Sets email configuration values

@return Map contains dynamic values to be replaced with place holders in Email Template at runtime
Sets email configuration values @return Map contains dynamic values to be replaced with place holders in Email Template at runtime
@Override
    public Map<String, Object> doEmailRequestProcess(StatisticsNdsRequest request,
            NdsSoapRequestAdapterExchangeProxy ndsExchange) {
        List<String> toList = Arrays.asList(
                ConfigurationFactory.getConfiguration().getString("admin.email.address").split("\\s*,\\s*"));
        Map<String, Object> emailConfigMap = new HashMap<String, Object>();
        emailConfigMap.put("type", "StatisticsTemplate");
        emailConfigMap.put("to", toList);
        emailConfigMap.put("submittedExemptionsCount", request.getNumberOfRegisteredExemptions());     
        emailConfigMap.put("domesticExemptionCount", request.getNumberOfDomesticExemptions());
        emailConfigMap.put("nonDomesticExemptionCount", request.getNumberOfNonDomesticExemptions());
        if (request.getFromDateTime() != null && request.getToDateTime() != null ) {
            emailConfigMap.put("fromDateTime",
                    request.getFromDateTime().format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")));
            emailConfigMap.put("toDateTime",
                    request.getToDateTime().format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm")));
        }
        emailConfigMap.put("successfulLoginsCount", request.getNumberOfSuccessfulLogins());
        emailConfigMap.put("failedLoginsCount", request.getNumberOfFailedLogins());
        emailConfigMap.put("emailTemplateFile",EMAIL_CONFIGURATION_FILE);
        if(request.getNumberOfDomesticExemptions() > 0) {
            emailConfigMap.put("domesticExemptions" ,  convertExemptionInfo(request.getDomesticExemptions()));
        }
        if(request.getNumberOfNonDomesticExemptions() > 0) {
            emailConfigMap.put("nonDomesticExemptions" ,  convertExemptionInfo(request.getNonDomesticExemptions()));
        }
        emailConfigMap.put("registrationCount", request.getNumberOfRegistration());
        emailConfigMap.put("changePasswordCount", request.getNumberOfChangePassword());
        emailConfigMap.put("resetPasswordCount", request.getNumberOfResetPassword());
        return emailConfigMap;
    }
@ Override public Map < String , Object > doEmailRequestProcess ( StatisticsNdsRequest request , NdsSoapRequestAdapterExchangeProxy ndsExchange ) { List < String > toList = Arrays . asList ( ConfigurationFactory . getConfiguration ( ) . getString ( "admin.email.address" ) . split ( "\\s*,\\s*" ) ) ; Map < String , Object > emailConfigMap = new HashMap < String , Object > ( ) ; emailConfigMap . put ( "type" , "StatisticsTemplate" ) ; emailConfigMap . put ( "to" , toList ) ; emailConfigMap . put ( "submittedExemptionsCount" , request . getNumberOfRegisteredExemptions ( ) ) ; emailConfigMap . put ( "domesticExemptionCount" , request . getNumberOfDomesticExemptions ( ) ) ; emailConfigMap . put ( "nonDomesticExemptionCount" , request . getNumberOfNonDomesticExemptions ( ) ) ; if ( request . getFromDateTime ( ) != null && request . getToDateTime ( ) != null ) { emailConfigMap . put ( "fromDateTime" , request . getFromDateTime ( ) . format ( DateTimeFormatter . ofPattern ( "dd/MM/yyyy HH:mm" ) ) ) ; emailConfigMap . put ( "toDateTime" , request . getToDateTime ( ) . format ( DateTimeFormatter . ofPattern ( "dd/MM/yyyy HH:mm" ) ) ) ; } emailConfigMap . put ( "successfulLoginsCount" , request . getNumberOfSuccessfulLogins ( ) ) ; emailConfigMap . put ( "failedLoginsCount" , request . getNumberOfFailedLogins ( ) ) ; emailConfigMap . put ( "emailTemplateFile" , EMAIL_CONFIGURATION_FILE ) ; if ( request . getNumberOfDomesticExemptions ( ) > 0 ) { emailConfigMap . put ( "domesticExemptions" , convertExemptionInfo ( request . getDomesticExemptions ( ) ) ) ; } if ( request . getNumberOfNonDomesticExemptions ( ) > 0 ) { emailConfigMap . put ( "nonDomesticExemptions" , convertExemptionInfo ( request . getNonDomesticExemptions ( ) ) ) ; } emailConfigMap . put ( "registrationCount" , request . getNumberOfRegistration ( ) ) ; emailConfigMap . put ( "changePasswordCount" , request . getNumberOfChangePassword ( ) ) ; emailConfigMap . put ( "resetPasswordCount" , request . getNumberOfResetPassword ( ) ) ; return emailConfigMap ; }
Sets email configuration values
Sets email configuration values