- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 02:35 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 04:36 AM
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 :
In this I'm hiding the OOB Email Client icon and insert my customized one.
This will help you brother 🙂
PS - Please mark Helpful, Like, or Correct Answer if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 04:36 AM
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 :
In this I'm hiding the OOB Email Client icon and insert my customized one.
This will help you brother 🙂
PS - Please mark Helpful, Like, or Correct Answer if applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2016 02:25 AM
Hi Chetan,
Thanks it works for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2016 03:05 AM
That's Great !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2018 05:19 AM
Hello,
Thank you for the tip.
Actually, we can simplify the url. It is not necessary to add the parameter ";incident.u_client_mail_type="+clientType+" in popupOpenEmailClient. The condition of the client email template is enough.
var url = "email_client.do?sysparm_table=incident&sysparm_sys_id="+id+"&sysparm_target=incident&sys_uniqueValue="+id;
popupOpenEmailClient(url);