- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 07:47 AM
Hello again,
i need a little help with the email client.
I found some threads like (1 / 2) but i dont get it 100% working.
I got a column in incident "u_mail" with some choices. Different Email Client Templates with a condition to the u_mail.
If i choose "Antwortmail" for example, click on the default email button (more Options) the Email Template "Antwortmail" opens. So this is working fine.
I copied a macro, but missing is the correct URL (??? in macro) to open the Email Client.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<a href="???" target="_blank" class="btn btn-default icon-mail"></a>
</j:jelly>
Or can i just copy the function from the default E-Mail Button (more options menue) to my button?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 05:14 AM
Hi,
Please refer below to fulfill requirement:
------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate>
var table, sys_id;
table = RP.getParameterValue('jvar_ref_table');
sys_id = current.sys_id;
var url1="/email_client.do?sysparm_table=incident&sysparm_sys_id=" + sys_id + "&sysparm_target=incident&sys_target=incident&sys_uniqueValue=" + sys_id + "&incident.u_mail_1=";
</g2:evaluate>
<a href="$[url1]" id="temp_link" target="_blank" class="btn btn-default icon-mail" onclick="test(this)">AA</a>
<input type="hidden" id="url_value" value="$[url1]"/>
<script>
function test(a){
var url = document.getElementById("url_value").value;
a.href=url+g_form.getValue("u_mail_1");
}
</script>
</j:jelly>
--------------------------------------------------------------------
Please mark reply as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 02:09 AM
Hi,
Can you please tell me what is use case here to use incident.u_mail_1 in url?
Are you able to get value of u_mail_1 field?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 02:22 AM
Use Case:
I got a choice field with 3 values. For each value i have an email client template.
when i select "antwortmail" and click the default email client button (under more option) everything is working fine.
Now i want to create a custom email button next to the choice field via ui macro.
But i have to tell the email client (via url) which email client template is to use.
(for example, condition for email client template antwortmail is "u_mail_1 = antwortmail"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 02:51 AM
Hi,
Okay, so you want to decide email template based on value in u_mail_1 field.
You must have created separate email client templates for different values in mail1 field. You need to add condition to those email templates itself as Mail1=<xyz>.
You do not need to add mail1 parameter in url.
Hope this resolves your issue/question.
If it helps, Please mark ✅ Correct and 👍 Helpful.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 03:25 AM
Okay, so you want to decide email template based on value in u_mail_1 field.
yes exactly.
You must have created separate email client templates for different values in mail1 field. You need to add condition to those email templates itself as Mail1=<xyz>.
I already have 3 email templates based on the value u_mail_1.
You do not need to add mail1 parameter in url.
yes, missing thing is to parse the value to the URL.
But i dont get the value (choice?)
06.06.2020 12:19
Information gr._u_mail_1: undefined
06.06.2020 12:19
Information gr.u_mail_1.getDisplayValue():
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 03:48 AM