How to send Email on a button Click and at the same time submit the record.

ashish9
Tera Contributor

We have a Related list on the Task form which is reference to a custom table u_table1.

When we click on New button it open a Dialog view of u_table1 table. 

On the custom form we have a button Send Email with a UI action {emailClientOpenPop('u_Table1');}which send an email from that popup after that it comes back to the custom form dialog view then we can submit the record  by submitting it.

But we want when the Email is sent and record should be submitted as well in 1 Click. Kindly suggest

6 REPLIES 6

Alok Das
Tera Guru

Hi Ashish,

You can create an event and trigger the created event on click of the button.

Now, configure the notification and in when to send form section set "Send when" to "Event is fired" and Select the event name which you created and triggering from UI Action. Also, from event you can decide who is recipient and if any data needs to be added you can send via parameters.

find_real_file.png

 

Kindly mark my answer as Correct and Helpful based on the Impact.

Regards,

Alok

ashish9
Tera Contributor

Thanks Alok Event will send Email in background we want Email template to open in Dialog then user will click send then come back to original form.  Event is working but in background

In that case you can go with a complete OOB Solution.

You can use email client which is OOB activated in incident table, the same you can do it for any other table and define the template which you want to be prepopulated there. It will be completely OOB and a quick solution.

How to configure Email Client? Please find the below link from docs to get the complete steps:

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/notification/task/enab...

Email client template:

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/notification/task/t_Cr...

 

Refer the below snipped for how to use the email client:

find_real_file.png

ashish9
Tera Contributor

Thank Alok, It work fine but requirement is little change here when on the SC Task form I click on a button it is opening dialog view of a form, from there I have to pop up a email template and then send email and at the same time it should submit record on dialog record form and come back to task form. See screenshot and 2 button there on Dialog 2 one to send email one for submit.