Send button on Email Client

PriyaRanji
Tera Guru

Hi All,

I am having the requirement to prompt the alert message when the user clicks "Send" button in the email client template. If you have any idea how to incorporate this changes?

(or) ui action to call ui page in the same way to show up the email client template and validation for the same.

Please do share the code that can achieve this functionality.

 

Thanks,

Priyanka R

1 ACCEPTED SOLUTION

PriyaRanji
Tera Guru

UI SCript to achieve 🙂

function manipulateEmailClient()

{

              try{

                             if(document.URL.indexOf("/email_client.do?sysparm_table=") != -1){

                                           document.getElementById("send_button").setAttribute("onclick", "alertme(event);");

                             }}

              catch(e){

                             console.log(e);

              }

}

function alertme(e){

              e.preventDefault();

              if (confirm("Are you sure to send an email")) {

                             sendIfOkay(event);

                            

              } else {

                             console.log("Error");

              }

}

addLoadEvent(manipulateEmailClient);

 

Thanks, hope it will help if anyone needs in future!

 

-Priyanka R

View solution in original post

8 REPLIES 8

PriyaRanji
Tera Guru

UI SCript to achieve 🙂

function manipulateEmailClient()

{

              try{

                             if(document.URL.indexOf("/email_client.do?sysparm_table=") != -1){

                                           document.getElementById("send_button").setAttribute("onclick", "alertme(event);");

                             }}

              catch(e){

                             console.log(e);

              }

}

function alertme(e){

              e.preventDefault();

              if (confirm("Are you sure to send an email")) {

                             sendIfOkay(event);

                            

              } else {

                             console.log("Error");

              }

}

addLoadEvent(manipulateEmailClient);

 

Thanks, hope it will help if anyone needs in future!

 

-Priyanka R

Hi @PriyaRanji , I'm also trying to apply the same type of functionality But I'm not able to trigger the UI script. where you have added this UI script API? please share the steps and scripts?

Hi Priya,

 

I have a similar requirement. Can you let me know from where you are calling the UI script?

 

Thanks!!

Steve McCulloug
Tera Contributor

Hi, I am also looking to create a confirmation pop-up when the user clicks 'send' in the email client, can you advise?
I have added the UI script above but it's not working.