Scenario
When sending email template to customers and it is triggered from payment record, some dynamic sourcing formulas on the templates need to be changed because the source routings are different.
Solution
Following Subject from an Email Template will work on Invoice records:Payment Receipt (${transaction.tranid} | ${entity.entityId}) - Company Name
However, to get the same Entity ID value for a Payment Record, the Sourcing is different:
Payment Receipt (${transaction.tranid} | ${transaction.customer.entityId}) - Company Name
This is because the Customer Record is not directly associated with the Payment Record. Payment Record will need to source the Customer ID from the Invoice Record that it is attached to.
Similarly, following if condition in an Email Template is valid on Invoice Records:
<#if customer.isPerson == "T">
For the email template to work from payment records, it should be modified to;
<#if transaction.customer.isPerson?string=="Yes">