Hide Order Custom Fields from confirmation email

Hi!
Is there a way to hide a order custom field from the confirmation email?

In this particular case, I have added a hidden field on the checkout flow which value has been set trough Javascript. Thus the customer does not need to see this data in the order confirmation mail.

In this case; the custom field is “ophaal-momentDEV”

Thank you!

Hi,

You may edit your email templates. In this particular case, the hidden custom fields should already be hidden by default. In the lines 192-213 of the default invoice email templates, it checks the type of each order custom field and does not show hidden types :

                {{ #has_any order.customFields }}
                    <table width="100%" cellpadding="5" cellspacing="0">
                        <tr>
                            <td>
                                <h3 size="12">Your order</h3>

                                <ul>
                                    {{ #each order.customFields }}
                                    {{ #if_not_eq type 'hidden' }}
                                    <li style="list-style-type: square">
                                        <span size="9">
                                            {{ cleanHtml name }}: {{ cleanHtml value }}
                                        </span>
                                    </li>
                                    {{ /if_not_eq}}
                                    {{ /each }}
                                </ul>
                            </td>
                        </tr>
                    </table>
                    {{ /has_any }}

Have you set the field to the hidden type or hid it otherwise?