// TODO(#496): replace with actual study's org name.
@Transactional()
  @Override
  public EmailResponse resendConfirmationthroughEmail(
      String applicationId, String securityToken, String emailId, String appName) {
    logger.info("UserManagementProfileServiceImpl - resendConfirmationthroughEmail() - Starts");
    AppEntity appPropertiesDetails = null;
    String content = "";
    String subject = "";
    AppOrgInfoBean appOrgInfoBean = null;
    appOrgInfoBean = commonDao.getUserAppDetailsByAllApi("", applicationId);
    appPropertiesDetails =
        userProfileManagementDao.getAppPropertiesDetailsByAppId(appOrgInfoBean.getAppInfoId());
    Map<String, String> templateArgs = new HashMap<>();
    if ((appPropertiesDetails == null)
        || (appPropertiesDetails.getRegEmailSub() == null)
        || (appPropertiesDetails.getRegEmailBody() == null)
        || appPropertiesDetails.getRegEmailBody().equalsIgnoreCase("")
        || appPropertiesDetails.getRegEmailSub().equalsIgnoreCase("")) {
      subject = appConfig.getConfirmationMailSubject();
      content = appConfig.getConfirmationMail();
    } else {
      content = appPropertiesDetails.getRegEmailBody();
      subject = appPropertiesDetails.getRegEmailSub();
    }
    templateArgs.put("appName", appName);
    // TODO(#496): replace with actual study's org name.
    templateArgs.put("orgName", appConfig.getOrgName());
    templateArgs.put("contactEmail", appConfig.getContactEmail());
    templateArgs.put("securitytoken", securityToken);
    EmailRequest emailRequest =
        new EmailRequest(
            appConfig.getFromEmail(),
            new String[] {emailId},
            null,
            null,
            subject,
            content,
            templateArgs);
    logger.info("UserManagementProfileServiceImpl - resendConfirmationthroughEmail() - Ends");
    return emailService.sendMimeMail(emailRequest);
  }
}
templateArgs.put("appName", appName);
// TODO(#496): replace with actual study's org name.
templateArgs.put("orgName", appConfig.getOrgName());
templateArgs.put("contactEmail", appConfig.getContactEmail());
|| (appPropertiesDetails.getRegEmailBody() == null)
|| appPropertiesDetails.getRegEmailBody().equalsIgnoreCase("")
|| appPropertiesDetails.getRegEmailSub().equalsIgnoreCase("")) {
subject = appConfig.getConfirmationMailSubject();
content = appConfig.getConfirmationMail();
} else {
content = appPropertiesDetails.getRegEmailBody();
subject = appPropertiesDetails.getRegEmailSub();
}
templateArgs.put("appName", appName);
// TODO(#496): replace with actual study's org name.
templateArgs.put("orgName", appConfig.getOrgName());
templateArgs.put("contactEmail", appConfig.getContactEmail());
templateArgs.put("securitytoken", securityToken);
EmailRequest emailRequest =
new EmailRequest(
appConfig.getFromEmail(),
new String[] {emailId},
null,
null,
subject,
AppEntity appPropertiesDetails = null;
String content = "";
String subject = "";
AppOrgInfoBean appOrgInfoBean = null;
appOrgInfoBean = commonDao.getUserAppDetailsByAllApi("", applicationId);
appPropertiesDetails =
userProfileManagementDao.getAppPropertiesDetailsByAppId(appOrgInfoBean.getAppInfoId());
Map<String, String> templateArgs = new HashMap<>();
if ((appPropertiesDetails == null)
|| (appPropertiesDetails.getRegEmailSub() == null)
|| (appPropertiesDetails.getRegEmailBody() == null)
|| appPropertiesDetails.getRegEmailBody().equalsIgnoreCase("")
|| appPropertiesDetails.getRegEmailSub().equalsIgnoreCase("")) {
subject = appConfig.getConfirmationMailSubject();
content = appConfig.getConfirmationMail();
} else {
content = appPropertiesDetails.getRegEmailBody();
subject = appPropertiesDetails.getRegEmailSub();
}
templateArgs.put("appName", appName);
// TODO(#496): replace with actual study's org name.
templateArgs.put("orgName", appConfig.getOrgName());
templateArgs.put("contactEmail", appConfig.getContactEmail());
templateArgs.put("securitytoken", securityToken);
EmailRequest emailRequest =
new EmailRequest(
appConfig.getFromEmail(),
new String[] {emailId},
null,
null,
subject,
content,
templateArgs);
logger.info("UserManagementProfileServiceImpl - resendConfirmationthroughEmail() - Ends");
return emailService.sendMimeMail(emailRequest);
}