HappyCowStudios Posted March 17, 2015 Share Posted March 17, 2015 I am trying to modify the default email Invoice template so that two lines are only displayed when the field in question is not null. The full code is below but the item in question is: Additional details: {$invoice_notes} If $invoice_notes is null, none of the above information should be displayed; if if is set, both items should be included in the email. This should be simple but I have tried if conditions for both HTML and PHP and neither works. Any ideas would be greatly appreciated. ______________________ Original code: Dear {$client_name}, This is a notice that an invoice has been generated on {$invoice_date_created}. Your payment method is: {$invoice_payment_method} Invoice #{$invoice_num} Amount Due: {$invoice_total} Due Date: {$invoice_date_due} Invoice Items {$invoice_html_contents} Additional details: {$invoice_notes} ------------------------------------------------------ You can login to your client area to view and pay the invoice at {$invoice_link} {$signature} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 18, 2015 Share Posted March 18, 2015 you can use an {if} statement to see if $invoice_notes contains anything and, if it does, display your additional text {if $invoice_notes}Additional details: {$invoice_notes}{/if} 0 Quote Link to comment Share on other sites More sharing options...
HappyCowStudios Posted March 19, 2015 Author Share Posted March 19, 2015 {if $invoice_notes} - that is what I needed!! Thank you so much! All the best! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.