Community Forum

Ask a Question
Back to All

Unable to send a custom notification

I'm able to send out a custom notification when using the rest API from postman for example, but I'm not managing to send out the notification from the code. I've tried invoking the Root object directly:

await root.notifications.triggerCustomEvent({
customEventKey: 'policy_anniversary_custom_notification',
customEventType: 'policy',
id: policy.policy_id,

as well as now with an action from the alteration hook:
name: 'trigger_custom_notification_event',
custom_event_key: 'policy_anniversary_custom_notification',
custom_event_type: 'policy',
policy_id: policy.policy_id,

But none of the above methods are working.

Please advise. An example of a policy that should have sent a notification is I can see two alterations where 'applied' one being the update_policy_module_data and the other being the trigger_custom_notification_event.

Thanks in advance,