PPM: How to send email by using GEL script?

Document ID : KB000017147
Last Modified Date : 15/10/2018
Show Technical Document Details
Question:
How to send email by using Gel script?
Need to use "CC" for email. Is there any sample code?

 
Environment:
PPM 15.2PPM 15.3
Answer:

There are 2 ways to send email by GEL script.

One is the usage of GEL Tag library and other is the usage of jelly library.

Case of GEL Tag library, it requires HTML mail format.

Case of jelly library, it requires plane text mail format. 

 

Sample GEL code with GEL Tag library: (HTML mail format)

<gel:script 

    xmlns:core="jelly:core"

    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary">

    <gel:email 

from="xxxx@xxx" 

to="yyyy@yyy" 

subject="Sample Email">

<![CDATA[ 

<html> 

<header></header> 

<body> 

<p>This is test email.<br></p> 

</body> 

</html>         

       ]]>  

    </gel:email>

</gel:script>

 

 

Sample GEL code with jelly library: plane text mail format (CC option are enabled)

 

<gel:script 

    xmlns:core="jelly:core"

    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"

    xmlns:email="jelly:email">

    <email:email 

                server="xxxxxxxxx"

                from="yyyy@yyy" 

                to="zzzz@zzz" 

                CC="aaaa@aaa"

                subject="Sample email">

                    This is test email.

    </email:email>

</gel:script>

 

Additional Information:
NOTE:
1)  When using <gel:email> tag it DOES NOT work if a space is present between email id's. 
      Example:  to="catechnicalsupport@ca.com; support@ca.com"  

2) But with <email:email> tag it works even if there is a space between email id's.