Skip to content

Commit

Permalink
Fix email sent before saving registrant
Browse files Browse the repository at this point in the history
  • Loading branch information
phuonghuynh committed Oct 13, 2015
1 parent e67a5ae commit f9239ad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ public ChallengeRegistrantEntity joinChallengeEntity(ChallengeRegistrantDto chal
if (!isExist) {
ChallengeRegistrantEntity challengeRegistrantEntity = dozerMapper.map(challengeRegistrantDto, ChallengeRegistrantEntity.class);
ChallengeEntity challengeEntity = challengeRepository.findOne(challengeId);
challengeRegistrantEntity.setRegistrantId(new Date().getTime());
challengeRegistrantEntity = challengeRegistrantRepository.save(challengeRegistrantEntity);
try {
sendApplicationEmailToContestant(challengeEntity, challengeRegistrantEntity);
sendApplicationEmailToEmployer(challengeEntity, challengeRegistrantEntity);
challengeRegistrantEntity.setRegistrantId(new Date().getTime());
challengeRegistrantEntity.setMailSent(Boolean.TRUE);
return challengeRegistrantRepository.save(challengeRegistrantEntity);
} catch (Exception e) {
Expand Down

0 comments on commit f9239ad

Please sign in to comment.