Displaying data in an email from one to many relation table
We know that boradLogRcp has a one to many relationship (1 to N) with recipient schema. So for every recipient I want to show all the emails sent to him/her
Here is how the email looks like
- Create a simple workflow to select the recipients of your choice
- Add a delivery/recurring delivery and pull the OTB default email template and configure it with below code
<TABLE>
<TBODY>
<TR>
<TD>Campaign name</TD>
<TD>Delivery Name</TD>
<TD>Event Date</TD>
</TR>
<%
for(var i = 0 ; i<recipient.broadLog.length; i++)
{
document.write("<tr>");
document.write("<td>" + recipient.broadLog[i].delivery.operation.label + "</td>");
document.write("<td>" + recipient.broadLog[i].delivery.label + "</td>");
document.write("<td>" + recipient.broadLog[i].eventDate + "</td>");
document.write("</tr>");
}
%>
</TR>
</TBODY>
</TABLE>
Comments
Post a Comment