in service/src/main/java/org/apache/fineract/cn/notification/service/listener/CustomerEventListener.java [69:90]
public void customerCreatedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
Customer customer = this.notificationService.findCustomer(payload, tenant).get();
this.logger.info("{} has been invoked", "customerCreatedEvent");
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, "customerCreatedEvent");
} else if (contact.getType().equals(ContactDetail.Type.EMAIL.toString())) {
String emailAddress = contact.getValue();
// TODO: Localize message
// TODO: Pass message to template
notificationService.sendEmail(
emailAddress,
"customerCreatedEvent",
payload);
}
});
}