Jump to content

Exclude text if notes field is null


Recommended Posts

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}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated