I'm creating new order emails for my company and need some help with the variables. I want to include an order comment in the email, but only if there actually is one. When the field is left empty at customer checkout, I still get this (yellow bar)...

enter image description here

How do I hide the row in the email when the field is left empty? If at all possible.

In the default emails it hides the row and the styling on when the field is left empty, and the code isn't that different.

Here's the code for the row in my email...

<tr align="center" style="background-color: #FFF0A3">
    <td width="650px" style="padding:8px; width:650px;">
        {{var comment}}

1 Answer 1

{{if comment}}
 {{var comment}}
  • Upvoted in preference to my idea ;)
    – sv3n
    May 9, 2017 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.