Merge pull request #345 from Kitzanos/new-email-content-prod

Cherry-pick (Changed email content for call #23)
This commit is contained in:
Rinaldo
2025-09-18 09:01:58 +02:00
committed by GitHub
3 changed files with 33 additions and 4 deletions

View File

@@ -594,7 +594,26 @@ public class GepafinConstant {
"</body>\n" + "</body>\n" +
"</html>"; "</html>";
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_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="<html>\n" +
" <body style=\"font-family: Arial, sans-serif; color: #000; line-height: 1.6;\">\n" +
" <div style=\"padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;\">\n" +
" <p><strong>DOCUMENTALE</strong></p>\n" +
" <p>Buongiorno,</p>\n" +
" <p>In riferimento al questionario antiriciclaggio\n" +
" “<strong>{{call_name}}</strong>“ di cui al <strong>Protocollo n. {{protocol_number}} del\n" +
" {{protocol_date}} e {{protocol_time}}</strong>, alla luce dell'attività istruttoria svolta,\n" +
" segnaliamo quanto segue:\n" +
" </p>\n" +
" {{note}}\n" +
" <p>Vi invitiamo a fornire quanto sopra richiesto integrando la documentazione sia caricandola all'interno dello sportello\n" +
" online <a href=\"{{platform_link}}\">{{platform_link}}</a> che inviandola a mezzo PEC all'indirizzo\n" +
" bandi.gepafin@legalmail.it entro e <strong>non oltre {{response_days}} giorni</strong> \n" +
" </p>\n" +
" <p>Distinti Saluti,</p>\n" +
" <p><strong>{{email_signature}}</strong></p>\n" +
" </div>\n" +
" </body>\n" +
"</html>";
} }

View File

@@ -1280,7 +1280,11 @@ public class ApplicationDao {
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_GEPAFIN, .retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_GEPAFIN,
hub, null); 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<>(); Map<String, String> subjectPlaceholders = new HashMap<>();

View File

@@ -18,6 +18,7 @@ import net.gepafin.tendermanagement.service.impl.EmailServiceFactory;
import net.gepafin.tendermanagement.util.DateTimeUtil; import net.gepafin.tendermanagement.util.DateTimeUtil;
import net.gepafin.tendermanagement.service.impl.SystemEmailService; import net.gepafin.tendermanagement.service.impl.SystemEmailService;
import net.gepafin.tendermanagement.util.Utils; import net.gepafin.tendermanagement.util.Utils;
import net.gepafin.tendermanagement.util.Validator;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -76,6 +77,9 @@ public class EmailNotificationDao {
@Autowired @Autowired
private SystemEmailTemplatesDao systemEmailTemplatesDao; private SystemEmailTemplatesDao systemEmailTemplatesDao;
@Autowired
private Validator validator;
private void sendEmail(ApplicationEntity applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum templateType, Map<String, String> bodyPlaceholders, private void sendEmail(ApplicationEntity applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum templateType, Map<String, String> bodyPlaceholders,
List<String> additionalRecipients, Long amendmentId) { List<String> additionalRecipients, Long amendmentId) {
@@ -95,8 +99,10 @@ public class EmailNotificationDao {
Map<String, String> bodyPlaceholders Map<String, String> bodyPlaceholders
) { ) {
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(templateType, hubEntity, null); SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(templateType, hubEntity, null);
if(Boolean.TRUE.equals(templateType.equals(SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST)) && Boolean.TRUE.equals(validator.isProductionProfileActivated()) && applicationEntity.getCall().getId().equals(23l)) {
Map<String, String> subjectPlaceholders = new HashMap<>(); systemEmailTemplateResponse.setHtmlContent(systemEmailTemplatesDao.replaceEmailSignature(hubEntity,GepafinConstant.APPLICATION_AMENDMENT_REQUESTED_MAIL_BODY,null));
}
Map<String, String> subjectPlaceholders = new HashMap<>();
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId()); CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName()); subjectPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
subjectPlaceholders.put("{{company_name}}", company.getCompanyName()); subjectPlaceholders.put("{{company_name}}", company.getCompanyName());