Updated code for the email signature while sending emails
This commit is contained in:
@@ -20,6 +20,7 @@ import net.gepafin.tendermanagement.service.CallService;
|
|||||||
import net.gepafin.tendermanagement.service.CompanyService;
|
import net.gepafin.tendermanagement.service.CompanyService;
|
||||||
import net.gepafin.tendermanagement.service.DocumentService;
|
import net.gepafin.tendermanagement.service.DocumentService;
|
||||||
import net.gepafin.tendermanagement.service.FormService;
|
import net.gepafin.tendermanagement.service.FormService;
|
||||||
|
import net.gepafin.tendermanagement.service.HubService;
|
||||||
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
||||||
import net.gepafin.tendermanagement.service.UserService;
|
import net.gepafin.tendermanagement.service.UserService;
|
||||||
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
||||||
@@ -127,6 +128,9 @@ public class ApplicationDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ProtocolDao protocolDao;
|
private ProtocolDao protocolDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HubService hubService;
|
||||||
|
|
||||||
|
|
||||||
public ApplicationResponseBean createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean, Long formId, Long applicationId) {
|
public ApplicationResponseBean createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean, Long formId, Long applicationId) {
|
||||||
FormEntity formEntity = formService.validateForm(formId);
|
FormEntity formEntity = formService.validateForm(formId);
|
||||||
@@ -699,9 +703,10 @@ public class ApplicationDao {
|
|||||||
CallEntity call =applicationEntity.getCall();
|
CallEntity call =applicationEntity.getCall();
|
||||||
CompanyEntity company = applicationEntity.getCompany();
|
CompanyEntity company = applicationEntity.getCompany();
|
||||||
ProtocolEntity protocol = applicationEntity.getProtocol();
|
ProtocolEntity protocol = applicationEntity.getProtocol();
|
||||||
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
||||||
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_USER_AND_COMPANY,
|
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_USER_AND_COMPANY,
|
||||||
call, null);
|
hub, null);
|
||||||
|
|
||||||
// Create the map for subject placeholders
|
// Create the map for subject placeholders
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
@@ -732,9 +737,10 @@ public class ApplicationDao {
|
|||||||
CallEntity call = applicationEntity.getCall();
|
CallEntity call = applicationEntity.getCall();
|
||||||
CompanyEntity company = applicationEntity.getCompany();
|
CompanyEntity company = applicationEntity.getCompany();
|
||||||
ProtocolEntity protocol = applicationEntity.getProtocol();
|
ProtocolEntity protocol = applicationEntity.getProtocol();
|
||||||
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
||||||
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_GEPAFIN,
|
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_TO_GEPAFIN,
|
||||||
call, null);
|
hub, null);
|
||||||
|
|
||||||
// Create the map for subject placeholders
|
// Create the map for subject placeholders
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package net.gepafin.tendermanagement.dao;
|
|||||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationAmendmentRequestEntity;
|
import net.gepafin.tendermanagement.entities.ApplicationAmendmentRequestEntity;
|
||||||
import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
import net.gepafin.tendermanagement.entities.ApplicationEntity;
|
||||||
|
import net.gepafin.tendermanagement.entities.HubEntity;
|
||||||
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity;
|
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity;
|
||||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||||
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
||||||
import net.gepafin.tendermanagement.repositories.CallRepository;
|
|
||||||
import net.gepafin.tendermanagement.service.ApplicationService;
|
import net.gepafin.tendermanagement.service.ApplicationService;
|
||||||
|
import net.gepafin.tendermanagement.service.HubService;
|
||||||
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
||||||
import net.gepafin.tendermanagement.service.UserService;
|
import net.gepafin.tendermanagement.service.UserService;
|
||||||
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
import net.gepafin.tendermanagement.util.DateTimeUtil;
|
||||||
@@ -36,14 +37,14 @@ public class EmailNotificationDao {
|
|||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
CallRepository callRepository;
|
private HubService hubService;
|
||||||
|
|
||||||
public void sendMailToNotifyBeneficiaryRegardingNewAmendment(ApplicationAmendmentRequestEntity applicationAmendmentRequest) {
|
public void sendMailToNotifyBeneficiaryRegardingNewAmendment(ApplicationAmendmentRequestEntity applicationAmendmentRequest) {
|
||||||
|
|
||||||
ApplicationEntity applicationEntity = applicationService.validateApplication(applicationAmendmentRequest.getApplicationId());
|
ApplicationEntity applicationEntity = applicationService.validateApplication(applicationAmendmentRequest.getApplicationId());
|
||||||
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
||||||
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST, applicationEntity.getCall(), null);
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.DOCUMENTATION_INTEGRATION_REQUEST, hub, null);
|
||||||
|
|
||||||
// Create the map for subject placeholders
|
// Create the map for subject placeholders
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
@@ -68,8 +69,9 @@ public class EmailNotificationDao {
|
|||||||
public void sendApplicationFailureNotificationEmail(ApplicationAmendmentRequestEntity amendmentRequest) {
|
public void sendApplicationFailureNotificationEmail(ApplicationAmendmentRequestEntity amendmentRequest) {
|
||||||
|
|
||||||
ApplicationEntity applicationEntity = applicationService.validateApplication(amendmentRequest.getApplicationId());
|
ApplicationEntity applicationEntity = applicationService.validateApplication(amendmentRequest.getApplicationId());
|
||||||
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
||||||
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE, applicationEntity.getCall(), null);
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.INADMISSIBILITY_NOTIFICATION_DUE_TO_FAILURE, hub, null);
|
||||||
|
|
||||||
// Create the map for subject placeholders
|
// Create the map for subject placeholders
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
@@ -93,8 +95,9 @@ public class EmailNotificationDao {
|
|||||||
public void sendAdmissibilityNotificationEmailForApprovedApplication(ApplicationAmendmentRequestEntity amendmentRequest) {
|
public void sendAdmissibilityNotificationEmailForApprovedApplication(ApplicationAmendmentRequestEntity amendmentRequest) {
|
||||||
|
|
||||||
ApplicationEntity applicationEntity = applicationService.validateApplication(amendmentRequest.getApplicationId());
|
ApplicationEntity applicationEntity = applicationService.validateApplication(amendmentRequest.getApplicationId());
|
||||||
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
||||||
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.ADMISSIBILITY_NOTIFICATION, applicationEntity.getCall(), null);
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.ADMISSIBILITY_NOTIFICATION, hub, null);
|
||||||
|
|
||||||
// Create the map for subject placeholders
|
// Create the map for subject placeholders
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
@@ -126,8 +129,9 @@ public class EmailNotificationDao {
|
|||||||
public void sendInadmissibilityEmailForRejectedApplication(ApplicationAmendmentRequestEntity amendmentRequest) {
|
public void sendInadmissibilityEmailForRejectedApplication(ApplicationAmendmentRequestEntity amendmentRequest) {
|
||||||
|
|
||||||
ApplicationEntity applicationEntity = applicationService.validateApplication(amendmentRequest.getApplicationId());
|
ApplicationEntity applicationEntity = applicationService.validateApplication(amendmentRequest.getApplicationId());
|
||||||
|
HubEntity hub = hubService.valdateHub(applicationEntity.getHubId());
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService.retrieveTemplateByTypeAndCall(
|
||||||
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.INADMISSIBILITY_TEMPLATE, applicationEntity.getCall(), null);
|
SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.INADMISSIBILITY_TEMPLATE, hub, null);
|
||||||
|
|
||||||
// Create the map for subject placeholders
|
// Create the map for subject placeholders
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class HubDao {
|
|||||||
hubRepository.save(hubEntity);
|
hubRepository.save(hubEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HubEntity validateHub(Long hubId) {
|
public HubEntity validateHub(Long hubId) {
|
||||||
return hubRepository.findById(hubId)
|
return hubRepository.findById(hubId)
|
||||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||||
Translator.toLocale(GepafinConstant.HUB_NOT_FOUND)));
|
Translator.toLocale(GepafinConstant.HUB_NOT_FOUND)));
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.CallEntity;
|
import net.gepafin.tendermanagement.entities.HubEntity;
|
||||||
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity;
|
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity;
|
||||||
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum;
|
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
||||||
@@ -25,24 +25,27 @@ public class SystemEmailTemplatesDao {
|
|||||||
@Value("${fe.base.url}")
|
@Value("${fe.base.url}")
|
||||||
private String feBaseUrl;
|
private String feBaseUrl;
|
||||||
|
|
||||||
|
@Value("${default.email.signature}")
|
||||||
|
private String defaultEmailSignature;
|
||||||
|
|
||||||
public SystemEmailTemplateResponse retrieveTemplate(SystemEmailTemplatesEntityTypeEnum type, CallEntity call, Locale language) {
|
|
||||||
|
public SystemEmailTemplateResponse retrieveTemplate(SystemEmailTemplatesEntityTypeEnum type, HubEntity hub, Locale language) {
|
||||||
SystemEmailTemplatesEntity dbSystemEmailTemplatesEntity = null;
|
SystemEmailTemplatesEntity dbSystemEmailTemplatesEntity = null;
|
||||||
if(call != null){
|
if(hub != null){
|
||||||
// dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
// dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
||||||
// .findByTypeAndCallId(type.getValue(), call.getId());
|
// .findByTypeAndCallId(type.getValue(), call.getId());
|
||||||
}
|
}
|
||||||
if(dbSystemEmailTemplatesEntity == null){
|
if(dbSystemEmailTemplatesEntity == null) {
|
||||||
dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
dbSystemEmailTemplatesEntity = systemEmailTemplatesRespository
|
||||||
.findByType(type.getValue());
|
.findByType(type.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = replaceHtmlContant(dbSystemEmailTemplatesEntity, call, language, Boolean.TRUE);
|
SystemEmailTemplateResponse systemEmailTemplateResponse = replaceHtmlContant(dbSystemEmailTemplatesEntity, hub, language, Boolean.TRUE);
|
||||||
return systemEmailTemplateResponse;
|
return systemEmailTemplateResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SystemEmailTemplateResponse replaceHtmlContant(SystemEmailTemplatesEntity dbSystemEmailTemplatesEntity,
|
private SystemEmailTemplateResponse replaceHtmlContant(SystemEmailTemplatesEntity dbSystemEmailTemplatesEntity,
|
||||||
CallEntity call, Locale language1, Boolean isDefaultReplace) {
|
HubEntity hub, Locale language1, Boolean isDefaultReplace) {
|
||||||
String language = null;
|
String language = null;
|
||||||
String htmlContent = dbSystemEmailTemplatesEntity.getHtmlContent();
|
String htmlContent = dbSystemEmailTemplatesEntity.getHtmlContent();
|
||||||
String subject = dbSystemEmailTemplatesEntity.getSubject();
|
String subject = dbSystemEmailTemplatesEntity.getSubject();
|
||||||
@@ -69,7 +72,8 @@ public class SystemEmailTemplatesDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
htmlContent = replacePlatformLinkPlaceholder(call, htmlContent, languageMap);
|
htmlContent = replacePlatformLinkPlaceholderAndEmailSignature(hub, htmlContent, languageMap);
|
||||||
|
subject = replacePlatformLinkPlaceholderAndEmailSignature(hub, subject, languageMap);
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = new SystemEmailTemplateResponse();
|
SystemEmailTemplateResponse systemEmailTemplateResponse = new SystemEmailTemplateResponse();
|
||||||
systemEmailTemplateResponse.setHtmlContent(htmlContent);
|
systemEmailTemplateResponse.setHtmlContent(htmlContent);
|
||||||
systemEmailTemplateResponse.setSubject(subject);
|
systemEmailTemplateResponse.setSubject(subject);
|
||||||
@@ -102,15 +106,28 @@ public class SystemEmailTemplatesDao {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
private String replacePlatformLinkPlaceholder(CallEntity call, String htmlContent,
|
private String replacePlatformLinkPlaceholderAndEmailSignature(HubEntity hub, String htmlContent,
|
||||||
Map<String, String> languageMap) {
|
Map<String, String> languageMap) {
|
||||||
String platformLink = feBaseUrl;
|
htmlContent = replacePlatformLinkPlaceholder(hub, htmlContent, languageMap);
|
||||||
|
htmlContent = replaceEmailSignature(hub, htmlContent, languageMap);
|
||||||
|
|
||||||
// if(hubEntity != null && Boolean.FALSE.equals(isEmpty(hubEntity.getDomainName()))){
|
|
||||||
// platformLink = hubEntity.getDomainName();
|
|
||||||
// }
|
|
||||||
htmlContent = htmlContent.replace("{{platform_link}}", platformLink);
|
|
||||||
return htmlContent;
|
return htmlContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String replaceEmailSignature(HubEntity hub, String htmlContent, Map<String, String> languageMap) {
|
||||||
|
String emailSignature = defaultEmailSignature;
|
||||||
|
if(hub != null && Boolean.FALSE.equals(StringUtils.isEmpty(hub.getEmailSignature()))){
|
||||||
|
emailSignature = hub.getEmailSignature();
|
||||||
|
}
|
||||||
|
return htmlContent.replace("{{email_signature}}", emailSignature);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String replacePlatformLinkPlaceholder(HubEntity hub, String htmlContent, Map<String, String> languageMap) {
|
||||||
|
String platformLink = feBaseUrl;
|
||||||
|
if(hub != null && Boolean.FALSE.equals(StringUtils.isEmpty(hub.getDomainName()))){
|
||||||
|
platformLink = hub.getDomainName();
|
||||||
|
}
|
||||||
|
return htmlContent.replace("{{platform_link}}", platformLink);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,4 +42,8 @@ public class HubEntity extends BaseEntity{
|
|||||||
|
|
||||||
@Column(name = "UNIQUE_UUID")
|
@Column(name = "UNIQUE_UUID")
|
||||||
private String uniqueUuid;
|
private String uniqueUuid;
|
||||||
|
|
||||||
|
@Column(name = "EMAIL_SIGNATURE")
|
||||||
|
private String emailSignature;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,5 @@ public interface HubService {
|
|||||||
void deleteHub(Long hubId);
|
void deleteHub(Long hubId);
|
||||||
HubEntity getHubByUuid(String hubUuid);
|
HubEntity getHubByUuid(String hubUuid);
|
||||||
HubResponseBean getHubByHubUuid(String uuid);
|
HubResponseBean getHubByHubUuid(String uuid);
|
||||||
|
HubEntity valdateHub(Long hubId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package net.gepafin.tendermanagement.service;
|
|||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.entities.CallEntity;
|
import net.gepafin.tendermanagement.entities.HubEntity;
|
||||||
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum;
|
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
||||||
|
|
||||||
public interface SystemEmailTemplatesService {
|
public interface SystemEmailTemplatesService {
|
||||||
|
|
||||||
SystemEmailTemplateResponse retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum type, CallEntity call, Locale language);
|
SystemEmailTemplateResponse retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum type, HubEntity hub, Locale language);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,4 +56,8 @@ public class HubServiceImpl implements HubService {
|
|||||||
public HubResponseBean getHubByHubUuid(String uuid) {
|
public HubResponseBean getHubByHubUuid(String uuid) {
|
||||||
return hubDao.getHubByHubUuid(uuid);
|
return hubDao.getHubByHubUuid(uuid);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public HubEntity valdateHub(Long hubId) {
|
||||||
|
return hubDao.validateHub(hubId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import net.gepafin.tendermanagement.dao.SystemEmailTemplatesDao;
|
import net.gepafin.tendermanagement.dao.SystemEmailTemplatesDao;
|
||||||
import net.gepafin.tendermanagement.entities.CallEntity;
|
import net.gepafin.tendermanagement.entities.HubEntity;
|
||||||
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum;
|
import net.gepafin.tendermanagement.entities.SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum;
|
||||||
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
import net.gepafin.tendermanagement.model.response.SystemEmailTemplateResponse;
|
||||||
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
import net.gepafin.tendermanagement.service.SystemEmailTemplatesService;
|
||||||
@@ -19,8 +19,8 @@ public class SystemEmailTemplatesServiceImpl implements SystemEmailTemplatesServ
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SystemEmailTemplateResponse retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum type, CallEntity call, Locale language) {
|
public SystemEmailTemplateResponse retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum type, HubEntity hub, Locale language) {
|
||||||
return systemEmailTemplatesDao.retrieveTemplate(type, call, language);
|
return systemEmailTemplatesDao.retrieveTemplate(type, hub, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,4 +61,5 @@ apiKey=xkeysib-d15439fedd7ff36d86676ac248153fc2c496ed9b879ca9dc8cee9a27fa309087-
|
|||||||
#senderEmail=mailer@bflows.net
|
#senderEmail=mailer@bflows.net
|
||||||
|
|
||||||
application.amendment.expiration.days=30
|
application.amendment.expiration.days=30
|
||||||
|
default.email.signature=Gepafin S.p.a
|
||||||
|
|
||||||
|
|||||||
@@ -1653,6 +1653,28 @@
|
|||||||
</addColumn>
|
</addColumn>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="31-10-2024_1" author="Rajesh Khore">
|
||||||
|
<addColumn tableName="hub">
|
||||||
|
<column name="EMAIL_SIGNATURE" type="TEXT"/>
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="31-10-2024_2" author="Rajesh Khore">
|
||||||
|
<sqlFile dbms="postgresql"
|
||||||
|
path="db/dump/updated_system_email_template_for_application_submition_30-10-2024.sql"/>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="31-10-2024_3" author="Rajesh Khore">
|
||||||
|
<update tableName="hub">
|
||||||
|
<column name="EMAIL_SIGNATURE" value="Gepafin S.p.a"/>
|
||||||
|
<where>UNIQUE_UUID = 'p4lk3bcx1RStqTaIVVbXs'</where>
|
||||||
|
</update>
|
||||||
|
<update tableName="hub">
|
||||||
|
<column name="EMAIL_SIGNATURE" value="Sviluppumbria S.p.a"/>
|
||||||
|
<where>UNIQUE_UUID = 't7jh5wfg9QXylNaTZkPoE'</where>
|
||||||
|
</update>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
UPDATE gepafin_schema.system_email_template SET html_content='<html>
|
||||||
|
<body style="font-family: Arial, sans-serif; color: #333; line-height: 1.6;">
|
||||||
|
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
|
||||||
|
<p>Buongiorno,</p>
|
||||||
|
<p>
|
||||||
|
Si comunica che, in riferimento alla domanda di concessione di
|
||||||
|
Finanziamento agevolato a valere sul Fondo prestiti
|
||||||
|
<strong>{{call_name}}</strong> di cui all''oggetto, la stessa è stata
|
||||||
|
regolarmente acquisita ed è stata registrata con Protocollo n.
|
||||||
|
<strong>{{protocol_number}}</strong> del <strong>{{date}}</strong> alle
|
||||||
|
<strong>{{time}}</strong>.
|
||||||
|
</p>
|
||||||
|
<p>Distinti Saluti,</p>
|
||||||
|
<p>
|
||||||
|
<strong>{{email_signature}}</strong>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>' WHERE "type"='APPLICATION_SUBMISSION_TO_USER_AND_COMPANY' AND "system"=true ;
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE gepafin_schema.system_email_template SET html_content='<html>
|
||||||
|
<body style="font-family: Arial, sans-serif; color: #333; line-height: 1.6;">
|
||||||
|
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
|
||||||
|
<p>
|
||||||
|
In riferimento alla domanda di concessione di Finanziamento agevolato a valere sul Fondo prestiti
|
||||||
|
<strong>{{call_name}}</strong> di cui all’oggetto, la stessa è stata regolarmente acquisita ed è stata
|
||||||
|
registrata con Protocollo n. <strong>{{protocol_number}}</strong> del <strong>{{date}}</strong> alle <strong>{{time}}</strong>.
|
||||||
|
</p>
|
||||||
|
<p>Distinti Saluti,</p>
|
||||||
|
<p>
|
||||||
|
<strong>{{email_signature}}</strong>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>' WHERE "type"='APPLICATION_SUBMISSION_TO_GEPAFIN' AND "system"=true;
|
||||||
|
|
||||||
Reference in New Issue
Block a user