Updated mail content for specific hub

This commit is contained in:
rajesh
2025-09-16 18:13:24 +05:30
parent 0688854824
commit 77f117e863
2 changed files with 28 additions and 1 deletions

View File

@@ -577,6 +577,23 @@ public class GepafinConstant {
public static final String USER_REQUEST_COMPLETED="user.request.completed";
public static final String END_DATE_GREATER_THAN_NOW="end.date.greater.than.now";
public static final String PEC_EMAIL_IS_REQUIRED = "pec.email.required";
public static final String APPLICATION_SUBMISSION_MAIL_BODY="<html>\n" +
"<body style=\"font-family: Arial, sans-serif; color: #333; line-height: 1.6;\">\n" +
" <div style=\"padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;\">\n" +
" <p>Buongiorno,</p>\n" +
" <p>\n" +
" Si comunica che, il <strong>“Modello AR1“<strong> di cui all'oggetto, è stato regolarmente acquisito ed è stato registrato con Protocollo n. \n" +
" <strong>{{protocol_number}}</strong> del <strong>{{date}}</strong> alle \n" +
" <strong>{{time}}</strong>.\n" +
" </p>\n" +
" <p>Distinti Saluti,</p>\n" +
" <p>\n" +
" <strong>{{email_signature}}</strong>\n" +
" </p>\n" +
" </div>\n" +
"</body>\n" +
"</html>";
public static final String APPLICATION_SUBMISSION_MAIL_SUBJECT="Modello AR1 GARANZIA PARTECIPAZIONI E FINANZIAMENTI S.P.A. - PER BREVITA' GEPAFIN S.P.A";
}

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());