- 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 01:48 AM
Hi,
I am able to get value of u_mail_1. Could you please add log in evaluation script to check mail1 value. Try gr.getDisplayValue("u_mail_1"), gr.u_mail_1, gr.getValue("u_mail_1").
You do not need separate gilderecord query in order get this field value.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 02:26 AM
can you please give me a help with the log 🙂
Is this correct?
gs.log("display value: " + gr.getDisplayValue("u_mail_1");
gs.log("gr mail value: " + gr._u_mail_1);
gs.log("mail value: " + mail);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 02:36 AM
Try this:
gs.log("current mail value: " + current.u_mail_1);
gs.log("mail value: " + current.getValue("u_mail_1"));
gs.log("display value: " + current.getDisplayValue("u_mail_1"));