diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index b7602d88..0ef82457 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -594,7 +594,26 @@ public class GepafinConstant { "\n" + ""; public static final String APPLICATION_SUBMISSION_MAIL_SUBJECT="Modello AR1 GARANZIA PARTECIPAZIONI E FINANZIAMENTI S.P.A. - PER BREVITA' GEPAFIN S.P.A"; - + public static final String APPLICATION_AMENDMENT_REQUESTED_MAIL_BODY="\n" + + " \n" + + "
\n" + + "

DOCUMENTALE

\n" + + "

Buongiorno,

\n" + + "

In riferimento al questionario antiriciclaggio\n" + + " “{{call_name}}“ di cui al Protocollo n. {{protocol_number}} del\n" + + " {{protocol_date}} e {{protocol_time}}, alla luce dell'attività istruttoria svolta,\n" + + " segnaliamo quanto segue:\n" + + "

\n" + + " {{note}}\n" + + "

Vi invitiamo a fornire quanto sopra richiesto integrando la documentazione sia caricandola all'interno dello sportello\n" + + " online {{platform_link}} che inviandola a mezzo PEC all'indirizzo\n" + + " bandi.gepafin@legalmail.it entro e non oltre {{response_days}} giorni \n" + + "

\n" + + "

Distinti Saluti,

\n" + + "

{{email_signature}}

\n" + + "
\n" + + " \n" + + ""; } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index dd54948a..b265fe92 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -1280,7 +1280,11 @@ public class ApplicationDao { .retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_GEPAFIN, 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 Map subjectPlaceholders = new HashMap<>(); diff --git a/src/main/java/net/gepafin/tendermanagement/dao/EmailNotificationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/EmailNotificationDao.java index 462958cb..a556d042 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/EmailNotificationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/EmailNotificationDao.java @@ -18,6 +18,7 @@ import net.gepafin.tendermanagement.service.impl.EmailServiceFactory; import net.gepafin.tendermanagement.util.DateTimeUtil; import net.gepafin.tendermanagement.service.impl.SystemEmailService; import net.gepafin.tendermanagement.util.Utils; +import net.gepafin.tendermanagement.util.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -76,6 +77,9 @@ public class EmailNotificationDao { @Autowired private SystemEmailTemplatesDao systemEmailTemplatesDao; + @Autowired + private Validator validator; + private void sendEmail(ApplicationEntity applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum templateType, Map bodyPlaceholders, List additionalRecipients, Long amendmentId) { @@ -95,8 +99,10 @@ public class EmailNotificationDao { Map bodyPlaceholders ) { SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(templateType, hubEntity, null); - - Map subjectPlaceholders = new HashMap<>(); + if(Boolean.TRUE.equals(templateType.equals(SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST)) && Boolean.TRUE.equals(validator.isProductionProfileActivated()) && applicationEntity.getCall().getId().equals(23l)) { + systemEmailTemplateResponse.setHtmlContent(systemEmailTemplatesDao.replaceEmailSignature(hubEntity,GepafinConstant.APPLICATION_AMENDMENT_REQUESTED_MAIL_BODY,null)); + } + Map subjectPlaceholders = new HashMap<>(); CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId()); subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName()); subjectPlaceholders.put("{{company_name}}", company.getCompanyName());