Following:
Sending Payment Notifications
Published 04/20/2012 08:32 PM | Updated 01/31/2020 05:35 AM | Answer Id: 21760
I am trying to customise the Payment Notification Email.
I have already created a new Advanced PDF/HTML Template for Bill Payments, and this works if created from a single Bill Payment.
It includes code to show the bills and credits applied (adapted from one of the inbuilt Advanced templates):
<#if record.apply?has_content>
<table class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start apply sublist --><#list record.apply as apply><#if apply_index==0>
<thead>
<tr>
<th style="width: 14%;">${apply.applydate@label}</th>
<th style="width: 28%;">Description</th>
<th style="width: 28%;">Applied To</th>
<th align="right" style="width: 15%;">Original Amount</th>
<th align="right" style="width: 15%;">Amount Due</th>
</tr>
</thead>
</#if><tr>
<td>${apply.applydate}</td>
<td>${apply.type} ${apply.refnum}</td><td></td>
<td align="right">${apply.total}</td>
<td align="right">${apply.due}</td>
</tr>
</#list>
<#if record.credit?has_content>
<#list record.credit as credit>
<tr>
<td>${credit.creditdate}</td>
<td>${credit.type} ${credit.refnum}</td>
<td>${credit.appliedto}</td>
<td align="right">${credit.amount}</td><td></td>
</tr>
</#list><!-- end credit--></#if>
<!-- end apply --></table>
<table class="total" style="width: 100%; margin-top: 10px;">
<tr class="totalrow">
<td align="right" style="width: 85%;"><b>Total Amount</b></td>
<td align="right" style="width: 15%;">${record.total}</td>
</tr>
</table>
</#if>
This works fine on the Advanced PDF Template.
Following the Suite Answers page above, I have created a new XML file for teh email template and uploaded to the File Cabinet.
It can be selected for the bulk email process, and will send an email. However, it doesn't appear to include the Credit item(s):
There are other formatting issues with the email template that I need to resolve, but I can't understand why the identical code works in Advanced PDF and not in Email.
Also, all of our other emails templates (generated in the normal way) have a simple text email, and then attach the PDF document. Is it possible to do this for the Payment Notifications, or does it have to be in the body of the email?