class AssetGroupEmailService implements Constants {

	public void executeEmailServiceForAssetGroup() {
	    log.info(EMAIL_SERVICE_STARTED);
		List<Map<String, Object>> ownerEmailDetails = notificationService.getAllAssetGroupOwnerEmailDetails();

        ExecutorService emailExecutor = Executors.newSingleThreadExecutor();
        String domainUrl = System.getenv("DOMAIN_URL");
	
		for(Map<String, Object> ownerEmailDetail : ownerEmailDetails) {
			emailExecutor.execute(new Runnable() {
	            @Override
	            public void run() {
	            	String ownnerName = ownerEmailDetail.get("ownerName").toString();
	                String assetGroupName = ownerEmailDetail.get("assetGroup").toString();
					String ownerEmail = ownerEmailDetail.get("ownerEmail").toString();
					sendDigestMail(assetGroupName, ownnerName, ownerEmail, mailTemplateUrl, domainUrl);
	            }
	        });
		}
		emailExecutor.shutdown();
		log.info(EMAIL_SERVICE_COMPLETED);
	}

}