Question

Photo of Abby Laguna

0

Why is lava not working correctly in email template?

Hi all!

I've been working on some HTML/Lava to use in an email for sending a sort of giving receipt. I have been testing the Lava in Reports and then pasting it over to the email template. The problem is that it is working in Reports but is giving an error in the email. I'm not sure why.

Here's the code

{% assign pId= {{ Person.Id }}%} 

    {% personalias where:'PersonId == {{ pId }}' %} 

    {% for personalias in personaliasItems %} 

     

{% financialtransaction dataview:'69' where:'AuthorizedPersonAliasId == {{ personalias.Id }}' %} 

  {% for financialtransaction in financialtransactionItems %} 

  {% assign transId = financialtransaction.Id %} 

    {% financialtransactiondetail where:'TransactionId == {{ transId }}' %} 

     {% for financialtransactiondetail in financialtransactiondetailItems %} 

         <tr><td colspan="3"><i>Team: {{ financialtransactiondetail.Account.PublicName }}</i><td></tr> 

         <tr> 

             

             <td><center>{{ currencySymbol }}{{ financialtransactiondetail.Amount }}</center></td> 

             {% assign batch = financialtransactiondetail.Transaction.BatchId %} 

             {% financialbatch id:'{{ batch }}' %} 

                 <td>{{ financialtransactiondetail.Transaction.FinancialPaymentDetail.CurrencyTypeValue.Value }}</td> 

                 <td>{{ financialtransactiondetail.Transaction.TransactionCode }}</td> 

             {% endfinancialbatch %} 

         </tr> 

         

     {% endfor %} 

  {% endfinancialtransactiondetail %} 

  {% endfor %} 

{% endfinancialtransaction %} 

{% endfor %} 

{% endpersonalias %}


tempsnip.png<< Lava column in Report

And then the error I'm getting in the email template is this: "Liquid error: Object reference not set to an instance of an object."

  • Photo of Abby Laguna

    0

    Update: So I guess that the communication detail block does not allow any Lava referencing anything but the Person entity. The Communication template itself will accept any normal Lava including financial entities and data views, but that doesn't help me with personalizing emails with giving statements.