From 6863749d1843cda62fdf35658ba13e3875970b00 Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Thu, 24 Dec 2015 16:21:29 +0700 Subject: [PATCH] Fix the issue on joining challenge --- .../service/impl/ChallengeEmailServiceImpl.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/techlooper/service/impl/ChallengeEmailServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeEmailServiceImpl.java index 03ad0c73b..4657fdd88 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeEmailServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeEmailServiceImpl.java @@ -176,7 +176,7 @@ public void sendEmailNotifyEmployerWhenPhaseClosed(ChallengeEntity challengeEnti public void sendApplicationEmailToContestant(ChallengeEntity challengeEntity, ChallengeRegistrantEntity challengeRegistrantEntity) { List subjectVariableValues = Arrays.asList(challengeEntity.getChallengeName()); String recipientAddresses = challengeRegistrantEntity.getRegistrantEmail(); - String templateName = EmailTemplateNameEnum.CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE.name(); + String templateName = EmailTemplateNameEnum.CHALLENGE_CONFIRM_USER_ON_JOIN_CHALLENGE.name(); if (challengeEntity.getChallengeType() == ChallengeTypeEnum.INTERNAL) { templateName = EmailTemplateNameEnum.CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE.name(); } @@ -372,15 +372,12 @@ private Map buildConfirmUserJoinChallengeEmailTemplateModel( templateModel.put("challengeId", String.valueOf(challengeEntity.getChallengeId())); templateModel.put("challengeNameAlias", challengeEntity.getChallengeName().replaceAll("\\W", "-")); -// if (challengeEntity.getChallengeType() == ChallengeTypeEnum.INTERNAL) { -// final int MIN_RANDOM_SEED_NUMBER = 1000; -// final int MAX_RANDOM_SEED_NUMBER = 9999; -// templateModel.put("passCode", DataUtils.getRandomNumberInRange(MIN_RANDOM_SEED_NUMBER, MAX_RANDOM_SEED_NUMBER)); -// } - - final int MIN_RANDOM_SEED_NUMBER = 1000; - final int MAX_RANDOM_SEED_NUMBER = 9999; - templateModel.put("passCode", String.valueOf(DataUtils.getRandomNumberInRange(MIN_RANDOM_SEED_NUMBER, MAX_RANDOM_SEED_NUMBER))); + if (challengeEntity.getChallengeType() == ChallengeTypeEnum.INTERNAL) { + final int MIN_RANDOM_SEED_NUMBER = 1000; + final int MAX_RANDOM_SEED_NUMBER = 9999; + templateModel.put("passCode", DataUtils.getRandomNumberInRange(MIN_RANDOM_SEED_NUMBER, MAX_RANDOM_SEED_NUMBER)); + } + return templateModel; }