Merge pull request #344 from Kitzanos/mail-content-prod

Cherry-pick (Changes mail content for call #23)
This commit is contained in:
Rinaldo
2025-09-16 14:58:11 +02:00
committed by GitHub
2 changed files with 28 additions and 1 deletions

View File

@@ -222,6 +222,9 @@ public class ApplicationDao {
@Autowired
private CallRepository callRepository;
@Autowired
private SystemEmailTemplatesDao systemEmailTemplatesDao;
public final Random random = new Random();
public ApplicationResponseBean createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean, Long formId, Long applicationId) {
@@ -1199,8 +1202,13 @@ public class ApplicationDao {
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_USER_AND_COMPANY,
hub, null);
if (Boolean.TRUE.equals(validator.isProductionProfileActivated()) && applicationEntity.getCall().getId().equals(23l)) {
systemEmailTemplateResponse.setHtmlContent(GepafinConstant.APPLICATION_SUBMISSION_MAIL_BODY);
systemEmailTemplateResponse.setHtmlContent(systemEmailTemplatesDao.replaceEmailSignature(hub,GepafinConstant.APPLICATION_SUBMISSION_MAIL_BODY,null));
systemEmailTemplateResponse.setSubject(GepafinConstant.APPLICATION_SUBMISSION_MAIL_SUBJECT);
}
// Create the map for subject placeholders
// Create the map for subject placeholders
Map<String, String> subjectPlaceholders = new HashMap<>();
subjectPlaceholders.put("{{call_name}}", call.getName());
subjectPlaceholders.put("{{company_name}}", company.getCompanyName());
@@ -1272,6 +1280,8 @@ public class ApplicationDao {
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_GEPAFIN,
hub, null);
// Create the map for subject placeholders
Map<String, String> subjectPlaceholders = new HashMap<>();
subjectPlaceholders.put("{{call_name}}", call.getName());