send email by clicking button on form

ggg
Giga Guru

I want to send an email via a form button.

ex: I open a form and click a button.

an email is generated containing a nicely formatted rendition of the fields on the form

and it is sent to the person who clicked the button.

I want it sent ONLY to the user that clicks the button

and ONLY for the form I am on.

 

 

5 REPLIES 5

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You could register an event and then use a ui action that fires an event and create a notification that runs against that event. You would pass the logged in user (person who clicked) and the record to the notification, and then the notification would pull in the the fields you specify in the format that you specify.

Upender Kumar
Mega Sage

Hi,

You can create a UI action and create a event. In UI action code all event. Create 

1. Create UI Action.

2. Register an event.

3. Create a notification that will be execute on event trigger.

 

Process:

In UI action call event and based on even notification will be sent.

 

 

Thanks

kushal Tayade
Mega Guru

 

First register an event in the Event Registry and then configure the forb button ui action to fire the created event. You can do this using gs.eventQueue method. You will also need to create a email notification that runs when that event is fired. So as soon as you will click the form button, gs.eventQueue will trigger the event thereby firing the email notification. The email should sent notification to the parameters used in gs.eventQueue below. 

gs.eventQueue('EVENT Name', current, gs.getUserID(), gs.getUserName());

 

 

ggg
Giga Guru

the trick here was that i wanted the email to be sent to the person who clicked the button ...

I solved this when i realized i can use a parm on my gs.eventQueue(x,x,x,x) and pass it the gs.getUserID().