send email notification using previous value

Ni Li
Tera Contributor

Does anyone know there is a way to trigger email notification/action programmatically via business rule?

 

The reason I'm asking is that when setting email notification in Notification, the state changes I would like to trigger the who to send in the notification may have cleared the column of the destination, but in business rule, the value I would like to retrieve value is coming from eg. previous.my_column.

 

Alternatively, is there a way to access previous.my_column in email script? 

6 REPLIES 6

SudhirG
Kilo Sage

Hi @Ni Li ,

You can create event and generate the event in business rule and send the previous value as an event parameter.

Create an email notification on the event trigger and you can fetch the event parameters in the mail script and use.

 

Please, mark answer correct or helpful based on the impact.

Thanks,

Sudhir G

Ni Li
Tera Contributor

Do you have the sample code of pushing previous values in the event queue? also, how do I ingest parameter for script in the email script?

Manmohan K
Tera Sage

Hi @Ni Li 

 

You can use eventQueue method to trigger notification using Business rule

 

gs.eventQueue('<eventRegisteryName>',current ,'parm1','parm2');

 

Example

gs.eventQueue('send.event.br', current, prevoius.myColumn, '');

 

You can use either options below to send list of users from event

 

ManmohanK_0-1686122018304.png

 

Ni Li
Tera Contributor

can we use previous to get the previous value in the eventQueue? the screenshot at the bottom won't work because as I said the value in this column will be wiped out while this notification happens. that's why I have to find a way to pull out the value in the column right before the notification triggers.