How to call functions defined in email notification scripts

dp11
Tera Guru

Hi,

In the OOB email notification script   "attach_links",   a function attachLinks() is defined. I have the following questions:

1. What is the syntax to call this function in an email notification or email template?

                      I tried ${mail_script:attach-links.attachLinks()} but it did not work

2. Can it be called in another email notification script?

Thanks,

Debashree

1 ACCEPTED SOLUTION

edwin_munoz
Mega Guru

Hello Pati,



1. You just need to include the email script:



${mail_script:attach_links}




If you go to the attach link script you will see that the attachLinks function is already called in the code:



Think of mail scripts as containers of code, once you add them to your email the script is going to be injected into your notification.



2. Technically you could do it, but I think you will have to do it inside your notification. Like this:



${mail_script:attach_links}




<mail_script>


        attachLinks();


</mail_script>






If you want to call a function in a script that is defined on another email script just call it like you would do it normally, just make sure that you add the email script that defined the function before calling it.


View solution in original post

11 REPLIES 11

edwin_munoz
Mega Guru

Hello Pati,



1. You just need to include the email script:



${mail_script:attach_links}




If you go to the attach link script you will see that the attachLinks function is already called in the code:



Think of mail scripts as containers of code, once you add them to your email the script is going to be injected into your notification.



2. Technically you could do it, but I think you will have to do it inside your notification. Like this:



${mail_script:attach_links}




<mail_script>


        attachLinks();


</mail_script>






If you want to call a function in a script that is defined on another email script just call it like you would do it normally, just make sure that you add the email script that defined the function before calling it.


Hi Edwin Munoz,



I need to call a email script function from Scheduled Report..


Is it possible..?


Please advice



Thanks


Prici