The CreatorCon Call for Content is officially open! Get started here.

Why is the event not firing?

honamiUeo
Tera Contributor

■assumption

・What we want to do is send an email to the users checked in the user table

・Email property settings.

honamiUeo_0-1694677348829.png

 

 

・I wrote this code in the script include

(In fact, we will store the address obtained from the ui action)

(I put sys_id Third argument and it didn't work.)

gs.eventQueue('sendEmail', current, 'sample@aaa.co.jp', 'firstname lastname');
 
・event registration
 
honamiUeo_1-1694677566447.png

 

・notification

 honamiUeo_2-1694677610519.png

 

・Checked.

Event parm 1 contains recipient
 
 
Can someone please help me?
 
1 ACCEPTED SOLUTION

DYCM
Mega Sage

Hello @honamiUeo ,

I think the issue is from the parameter1.png2.png

sysparam_checked in UI Action

sysparm_checked in Script Include

View solution in original post

23 REPLIES 23

@Ankur Bawiskar 

Sorry for the confusing explanation.

>so were you saying earlier that event is getting triggered but email is not sent because that's >what your question said.

→Yes, it is.

 

>now that you are saying event is getting processed why email is not getting triggered?

→I just don't understand why.

 

>is that user having notification preference enabled?

→I have notifications enabled.

honamiUeo_0-1694739516310.png

 

Sorry, I will close this once I have resolved the main issue of the event not firing.
The cause of the event not firing was a typo on my part. Thank you very much for your help.

asifnoor
Kilo Patron

Hi,

 

As per yoru client script, you arepassing the list ofuser sys_ids to SI. But in your SI, you are triggering the event, with the current object.

 

You might have to gliderecord the user table, and pass the user object in this line. Then the event will trigger.

Hi,

 

Since you are calling the SI from client script, i am not sure current object will be availble in server side. In SI, Here you need to get the user record

gs.eventQueue('sendEmail', current, 'sample@aaa.co.jp''firstname lastname');
 
Kindly mark the comment as a correct answer if this has helped to solve the problem.

@asifnoor 

 

Nice to meet you and thank you for your support.

SI describes the following process.
Is there any flaw in this approach?

 

honamiUeo_1-1694682484383.png

 

As i said earlier, you cannot pass current object. you need to pass user object there, which is gr.

Secondly, before firignt he event, add a log and check if you are gettign this log or not. 

 

gs.info("Entered here "+gr.first_name);