How to add email client template parameter in popupOpenEmailClient

Ravindra Rausha
Giga Contributor

Hi,

I have created two email client template for incident. So I want to populate specific email client template in email client window.

How to add email client template parameter in popupOpenEmailClient?

Thanks,

Ravindra

1 ACCEPTED SOLUTION

Chetan Sondhi
Kilo Sage

Hi Ravindra,



Hope you doing well .


For this what you can do is to have your custom client email icon set and that can be achieved by onLoad Client Script .


You can set the email client template based on any value for Incident form by setting the parameter in popupOpenEmailClient function like this :



popupOpenEmailClient("email_client.do?sysparm_table=incident&sysparm_sys_id="+id+"&sysparm_target=incident&sys_uniqueValue="+id+"&sys_row=0&sysparm_encoded_record=&incident.u_client_mail_type="+clientType+"&sysparm_stack=no");



Here, u_client_mail_type is a field on the basis of which I am setting the email client parameter.


You also have to add condition with the two Email Client Templates that you have in Email Client Template table.


For e.g. EmailClientTemplate1 with condition "u_client_mail_type=assigned_to"


& EmailClientTemplate2 with condition "u_client_mail_type=user"



I've tried this at my instance and it worked .Client Script is something like this :



find_real_file.png



In this I'm hiding the OOB Email Client icon and insert my customized one.



find_real_file.png




This will help you brother 🙂



PS - Please mark Helpful, Like, or Correct Answer if applicable.


View solution in original post

8 REPLIES 8

Hi Chetan, can you please take a look at my question?

 

https://community.servicenow.com/community?id=community_question&sys_id=6e30ab93dbf0ef44feb1a851ca961952&anchor=answer_826fa717dbf4a7482be0a851ca9619ec

 

Much appreciated.

Hello, 

 

I have an requirement to write the customized code for the client where i need to do the validation when the user click on "Send" button in the email client template. Could you please help me on achieving this?

 

Thanks,

Priyanka R

urmilla
Kilo Guru

Hi Chetan,



I have a similar requirement. I want add the parameter for email client template specifically in popupOpenEmailClient. is there a way to embed the same? A syntax I should follow.



Thanks,


Urmilla


karanshah
ServiceNow Employee
ServiceNow Employee

Is this client template or just template because in client templates I dont see any condition ?