Go to Preferences → Email & Notifications:
Click on the big New Order Notification button:
In the body of your email template, add the following code, then save:
{% if discounts %}Discount code: {{ discounts.first.code }}{% endif %}
Currently, there can only be one discount applied per order (not applicable, but applied), so the discounts “array” will only contain 0 or 1 element, but it may be possible to apply many discount codes to the same order in the future. When Shopify implements that, the Liquid code to use will become:
{% if discounts %}Discount {{ discounts.size | pluralize: 'code', 'codes' }}:{% for discount in discounts %} {{ discount.code }}{% endfor %}{% endif %}
