AnsweredAssumed Answered

[Q] Help with HTML Gel Email

Question asked by Keri Taylor on Feb 21, 2017
Latest reply on Feb 21, 2017 by Keri Taylor

Hello All, I am having some trouble with my HTML email. I can't seem to get this to display the contents of the table. I have tried this a few ways, the header is building but not the contents. 

 

          <gel:email from="${sender}" to="${me}" subject="${subject}">
               <![CDATA[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD/>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
]]>
<![CDATA[<P ALIGN="left"><B>]]>Dear Project Manager(s),<![CDATA[</B></P>]]>
<![CDATA[<P ALIGN="left">]]>${messageText1}<![CDATA[</P>]]>

     <sql:query escapeText="0" var="prj">
          <![CDATA[
     SELECT pm.full_name
     , P.NAME
     , P.code
     FROM prteam tm
     join inv_investments P on tm.prprojectid=tm.prprojectid
     JOIN inv_projects inv ON P.ID=inv.prid
     JOIN srm_resources pm on p.manager_id=pm.user_id
     WHERE P.is_active = 1
     AND inv.is_template = 0
     and p.is_open_for_te = 1
     AND pm.is_active = 1
     AND P.manager_id IN (5011208, 5011571, 5011925, 5011933, 5034026, 5039001)
     AND tm.prresourceid=5011623
     AND tm.prisopen = 1
     group by pm.full_name
     , P.NAME
     , P.code
     ORDER BY pm.FULL_name
     ]]>

     </sql:query>
     
<![CDATA[
<TABLE ALIGN="left" BORDER=1 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
<TR ALIGN="left" VALIGN="middle">
     <TH>]]>
Project Manager<![CDATA[</TH>
     <TH>]]>
Project ID<![CDATA[</TH>
     <TH>]]>
Project Name<![CDATA[</TH>
</TR>]]>
     
               <core:forEach items="${prj.rows}" var="row">
                    <core:set var="proj_manager" value="${row.proj_manager}"/>
                    <core:set var="proj_id" value="${row.proj_id}"/>
                    <core:set var="proj_name" value="${row.proj_name}"/>               
                    <!-- Project Manager: ${full_name}, Project ID: ${proj_id} , Project Name: ${proj_name} -->

<![CDATA[
<TR ALIGN="left" VALIGN="middle">
     <TD>]]>
${proj_manager}<![CDATA[</TD>
     <TD>]]>
${proj_id}<![CDATA[</TD>
     <TD>]]>
${proj_name}<![CDATA[</TD>
</TR>
</TABLE>]]>

               </core:forEach>
<![CDATA[
</BODY>
</HTML>
]]>

          </gel:email>

Or this way

          <gel:email from="${sender}" subject="${subject}" to="${me}">

&lt;P ALIGN="left"&gt;&lt;B&gt;
Dear Project Manager(s),&lt;/B&gt;&lt;/P&gt;
&lt;P ALIGN="left"&gt;${messageText1}&lt;/P&gt;
&lt;/br&gt;&lt;/br&gt;

          <sql:query escapeText="0" var="prj">
     SELECT pm.full_name
     , P.NAME
     , P.code
     FROM prteam tm
     join inv_investments P on tm.prprojectid=tm.prprojectid
     JOIN inv_projects inv ON P.ID=inv.prid
     JOIN srm_resources pm on p.manager_id=pm.user_id
     WHERE P.is_active = 1
     AND inv.is_template = 0
     and p.is_open_for_te = 1
     AND pm.is_active = 1
     AND P.manager_id IN (5011208, 5011571, 5011925, 5011933, 5034026, 5039001)
     AND tm.prresourceid=5011623
     AND tm.prisopen = 1
     group by pm.full_name
     , P.NAME
     , P.code
     ORDER BY pm.FULL_name
     </sql:query>
     
&lt;TABLE ALIGN="left" BORDER=1 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"&gt;
&lt;TR ALIGN="left" VALIGN="middle"&gt;
&lt;TH&gt;Project Manager&lt;/TH&gt;
&lt;TH&gt;Project ID&lt;/TH&gt;
&lt;TH&gt;Project Name&lt;/TH&gt;
&lt;/TR&gt;
               <core:forEach trim="true" items="${prj.rows}" var="row">
                    <core:set var="proj_manager" value="${row.proj_manager}"/>
                    <core:set var="proj_id" value="${row.proj_id}"/>
                    <core:set var="proj_name" value="${row.proj_name}"/>               
                    <!-- Project Manager: ${full_name}, Project ID: ${proj_id} , Project Name: ${proj_name} -->
          

&lt;TR ALIGN="left" VALIGN="middle"&gt;
&lt;TD&gt;${proj_manager}&lt;/TD&gt;
&lt;TD&gt;${proj_id}&lt;/TD&gt;
&lt;TD&gt;${proj_name}&lt;/TD&gt;
&lt;/TR&gt;

               </core:forEach>
&lt;/TABLE&gt;
&lt;/br&gt;&lt;/br&gt;
&lt;/br&gt;&lt;/br&gt;

          </gel:email>

 

Both of these display this way. 

 

Email

I am not sure what i am doing wrong on these. Any help would be greatly appreciated. 

 

Keri

Outcomes