Order Notes in email template
Order Notes in email template
Customer can add Order Notes on the Checkout Page. Is it possible to add these notes to the Order Confirmation email? If so, what would I need to add to the template?
Re: Order Notes in email template
You can try following code and place it just above the </body> tag of your Customer Order Notification Email template contents.
This will print all the public notes from that order at the very end of Email.
Code: Select all
#foreach ($note in $order.Notes)
#beforeall
<table class="Email">
<tr>
<th class="Email">Order Notes</th>
</tr>
</table>
<table class="Email">
<tr>
<td style="background:#cccccc; color:#00000; text-align: center;"><strong>Author</strong></td>
<td style="background:#cccccc; color:#00000; text-align: center;"><strong>Note</strong></td>
</tr>
#each
#if(!($note.IsSystem || $note.IsPrivate))
<tr class="Email">
<td class="Email" style="text-align: left;">
$note.User.UserName
</td>
<td class="Email" style="text-align: left;">
$note.Comment
</td>
</tr>
#end
#afterall
</table>
#end
Re: Order Notes in email template
Thanks! One more quick question - the header is showing up even if I don't have any Notes. I tried wrapping the following around your code but it doesn't seem to work. What did I do wrong?
Code: Select all
#if ($order.Notes.Count > 0)
your code
#end
Re: Order Notes in email template
I guess I need to check to see if the Count of Public notes is greater than 0, nevermind