Email Notification was not triggered to users even after the event got processed


Description

The email notification will not trigger even the after condition matches and we can see the below error message "Exception: id must be provided" in the logs. Below are the sample logs for reference:

id must be provided: java.lang.IllegalArgumentException: id must be provided: com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
com.glide.notification.cmn.CmnNotifDeviceRepository.getById(CmnNotifDeviceRepository.java:379)
com.glide.notification.cmn.NotificationRecipientsBuilder.processUserNotificationMessage(NotificationRecipientsBuilder.java:697)
com.glide.notification.cmn.NotificationRecipientsBuilder.lambda$moveUsersToRecipients$0(NotificationRecipientsBuilder.java:668)
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1628)
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
com.glide.notification.cmn.NotificationRecipientsBuilder.moveUsersToRecipients(NotificationRecipientsBuilder.java:669)
com.glide.notification.cmn.NotificationRecipientsBuilder.build(NotificationRecipientsBuilder.java:213)
com.glide.notification.cmn.NotificationActionHandler.send(NotificationActionHandler.java:95)

Release or Environment

Orlando Patch 9b

Cause

The Exception "Exception: id must be provided" states that the user record in the "cmn_notif_message" table contains an empty value in the "Device" field. Sometimes we can see the value from the UI but from the XML view, we can see that the value is empty. 

As per the platform code designed, when the user has the "Device" field empty in the "cmn_notif_message" table the notification will not send to the user.

Resolution

In order to fix this issue we can follow any of the below steps

For example, as per the out of the box, the device field will be displayed as below in the record XML view

<device display_value="Primary email">9b4016f1db310010016754c0cf9619f7</device>

From the UI we can see the device field will be displayed as per the screenshot.