Send email with UI Action

Carlos52
Tera Expert

Hi everyone,

 

I created a button with a UI Action to send an email while inside a ticket, however it's not triggering:

find_real_file.png

I created an Event Registration, an Email Notification (with "Event parm 1 contains recipient" checked) and this UI action.

The UI Action it's not even triggering the info message when the 3rd line is active, so I wonder if I'm missing something obvious? Am I not supposed to call the event from inside a UI action?

 

Thanks in advance for any help!

 

1 ACCEPTED SOLUTION

RaghavSh
Kilo Patron

This is not work as gs.eventQueue() is a server side function and you are calling it in client side code.

Anything written in the onclick function in UI action act as a client side code, you need to remove the on click function and write this code directly in UI action script, then it will work.


Raghav
MVP 2023
LinkedIn

View solution in original post

3 REPLIES 3

RaghavSh
Kilo Patron

This is not work as gs.eventQueue() is a server side function and you are calling it in client side code.

Anything written in the onclick function in UI action act as a client side code, you need to remove the on click function and write this code directly in UI action script, then it will work.


Raghav
MVP 2023
LinkedIn

I Raghav,

 

Thanks for your help, I had to uncheck the "Client" box.

I've attached a screenshot of the final result, should anyone else face the same problem in the future:

find_real_file.png

Lines 1 and 10 are responsible for sending the email.

Aishwarya Thaku
Tera Expert

Hi @Carlos ,

 

Replace the line gs.eventQueue('call.back.email', test); from your code to -

gs.eventQueue("call.back.email", current, test, '');

where,

call.back.email - should be your event name

current - current GlideRecord

test - contains the recipient of the email notification

 

Please mark my answer as helpful or correct, if applicable.

Thanks,

Aishwarya