Hello Everyone,
I am writing a GEL Script to send a notification IT Manager and Business Manager. If IT Manager is present, the email goes to go to only IT Manager. If IT Manager is not present, the email has to go to only Business Manager. If both are present, it has to go only IT Manager.
I wrote a script but it is kind of stuck when both are present. Here is the code script alone that where I am mixing things.
Any thoughts ?
<core:if test="${result2.rowCount > 0}"><core:if test="${result2.rowCount > 0}"> <core:forEach items="${result2.rows}" trim="true" var="row2">
<gel:log trim="false"> Sending Email...${row2.ProjectID} Email Recipient: ${row2.pmemail}${row2.itpmemail}</gel:log> <core:catch var="mailException"> <gel:email from="PPM Admin" subject="PPM Reminder Email - Resource Hours" to="${row2.pmemail}${row2.itpmemail}"> <![CDATA[ <html> <head> <meta charset="UTF-8"> <style> #emailBody { font-family : Calibri, arial; font-size: 14px; } </style> </head>
<body><div id="emailBody"> Dear ${row2.resName},<br/> <br/> ]]> <core:choose> <core:when test="${row2.itpmid != null and row2.pmid == null}"><![CDATA[ This is a general reminder to enter allocation hours. ]]> </core:when> <core:when test="${row2.itpmid == null and row2.pmid != null}"><![CDATA[ This is a general reminder to enter allocation hours. ]]> </core:when> </core:choose>
<![CDATA[ <br/> <br/> <strong>Note: </strong> This is a system generated email. Please do not reply. </div> </body> </html> ]]> </gel:email> </core:catch>
<core:if test="${!empty mailException}"> <gel:log>${mailException}</gel:log> </core:if>
</core:forEach> </core:if>