in service/src/main/java/org/apache/fineract/cn/notification/service/listener/CustomerEventListener.java [96:119]
public void customerUpdatedEvents(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
this.logger.info("{} has been invoked", "customerUpdatedEvent");
Customer customer = this.notificationService.findCustomer(payload, tenant).get();
customer.getContactDetails().forEach(contact -> {
if (contact.getType().equals(ContactDetail.Type.PHONE.toString())) {
String receiverNumber = contact.getValue();
// TODO: Localize message
// TODO: Pass message to template
notificationService.sendSMS(receiverNumber,
"customerUpdatedEvent"
);
} else if (contact.getType().equals(ContactDetail.Type.EMAIL.toString())) {
String emailAddress = contact.getValue();
// TODO: Localize message
// TODO: Pass message to template
notificationService.sendEmail(
emailAddress,
"customerUpdatedEvent",
payload);
}
});
}