<p>I don't know exactly why, but I copied the template from the other status and just changed the text differences, and it worked. There was minor differences as I put them side by side in <a href="https://www.diffchecker.com/" rel="nofollow noreferrer">https://www.diffchecker.com/</a> , so I assume it was some error in spacing or a missing comma somewhere (it works, so I'm happy), here is the new code that worked:</p>

<pre><code>{% set order = craft.commerce.orders.number(order.number).first() %}
</code></pre>

<p>


  
  
  
    * {
      font-family: 'Helvetica', 'Arial', sans-serif;
    }</p>

<pre><code>body {
  margin: 0;
  padding: 0;
  min-width: 100%;
}

#container{
  max-width: 700px;
  margin-top: auto;
  margin-right: auto;
  margin-bottom: auto;
  margin-left: auto;
}

h1{
  font-size: 28px;
}

h2{
  font-size: 22px;
}

p{
  font-size: 16px;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 30px;
}

td,
th {
  padding: 5px;
  border: none;
  vertical-align: top;
  text-align: left;
}

table#order-summary td{
  border-bottom: 1px solid #ccc;
}

table#customer td{
  width: 50%;
}
</code></pre>

<p>
</p>

<p>
  
    {{"Ordrebekreftelse"|t}}</p>

<pre><code>&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Hei!"}}&lt;br style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
{{"tusen takk for at du valgte å handle hos Vaskogsol!"|t}}&lt;/p&gt;

&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Nedenfor finner du en oppsummering av din ordre. Vennligst kontakt oss umiddelbart dersom noe ikke stemmer."|t}}&lt;/p&gt;

&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Referanse:"|t}} #{{order.id}}&lt;/p&gt;
&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Dato:"|t}} {{order.dateOrdered}}&lt;/p&gt;
&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Status:"|t}} {{order.orderStatus}}&lt;/p&gt;

&lt;h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;"&gt;{{"Oppsummering"|t}}&lt;/h2&gt;
&lt;table id="order-summary" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;"&gt;
  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Produkt"|t}}&lt;/th&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Pris"|t}}&lt;/th&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Antall"|t}}&lt;/th&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Totalt"|t}}&lt;/th&gt;
  &lt;/tr&gt;

  {% for item in order.lineItems %}
    &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
      &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{item.description}}
        &lt;!-- SKU: {{item.sku}} --&gt;
      &lt;/td&gt;
      &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;
        {% if item.onSale %}
          &lt;strike style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;{{item.price + formatNOK}} &lt;/strike&gt; {{item.salePrice + formatNOK}} kr
        {% else %}
          {{item.price + formatNOK}} kr
        {% endif %}
      &lt;/td&gt;
      &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{item.qty}}&lt;/td&gt;
      &lt;td class="text-right" style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{item.total + formatNOK}} kr&lt;/td&gt;
    &lt;/tr&gt;
  {% endfor %}

  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="text-transform: none; font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Frakt:"|t}} {% if order.shippingMethod.getName() == "" %}{{"Ikke valgt enda"|t}}{% else %}{{order.shippingMethod.getName()}}{% endif %}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{order.totalShippingCost + formatNOK}} kr&lt;/td&gt;
  &lt;/tr&gt;

  {% if order.totalDiscount != "" %}
  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="text-transform: none; font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Rabatt"|t}}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{order.totalDiscount + formatNOK}} kr&lt;/td&gt;
  &lt;/tr&gt;
  {% endif %}

  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Totalt"|t}}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{order.totalPrice + formatNOK}} kr&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Herav MVA (25%)"|t}}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;
</code></pre>

<p>{% set total_vat = order.totalTaxIncluded %}
{% for adjustment in order.adjustments %}
  {% if adjustment.name == 'Shipping VAT' and adjustment.amount > 0 %}
    {% set total_vat = total_vat + adjustment.amount %}
  {% endif %}
{% endfor %}
{{total_vat + formatNOK}} kr</p>

<pre><code>      &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;table id="customer" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;"&gt;
  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;"&gt;
      &lt;h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;"&gt;{{"Leveringsadresse"|t}}&lt;/h2&gt;
      {% if order.shippingAddress %}
        {% include '_includes/addresses/address' with { address: order.shippingAddress } %}
      {% endif %}
    &lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;"&gt;
      &lt;h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;"&gt;{{"Fakturaadresse"|t}}&lt;/h2&gt;
      {% if order.billingAddress %}
        {% include '_includes/addresses/address' with { address: order.billingAddress } %}
      {% endif %}
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;Vask og Sol AS&lt;br style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
Org. nr. 876543219&lt;br&gt;
&lt;a href="http://vaskogsol.no" style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;vaskogsol.no&lt;/a&gt;
&lt;/p&gt;
</code></pre>

<p>

</p>

CC BY-SA 3.0
2017-05-09T06:38:57.970Z
2017-05-09T06:38:57.970Z
Vegard
<p>I am getting this error in the commerce.log:</p>

<pre><code>2017/05/08 23:18:49 [error] [plugin] [Forced] Epostmal analysefeil for epost “Behandles”. Bestilling: “097793b”. Malfeil: “An error occurred when rendering a template.”
</code></pre>

<p>I can't seem to find what's making the template error, as my other templates works as normal and I receive these emails (so the email system and templates work when changing status for orders, just this template that does not send out the email).</p>

<p>Any help would be appreciated.</p>

<p>The template is the following code:</p>

<pre><code>{% set order = craft.commerce.orders.number(order.number).first() %}
</code></pre>

<p>


  
  
  
    * {
      font-family: 'Helvetica', 'Arial', sans-serif;
    }</p>

<pre><code>body {
  margin: 0;
  padding: 0;
  min-width: 100%;
}

#container{
  max-width: 700px;
  margin-top: auto;
  margin-right: auto;
  margin-bottom: auto;
  margin-left: auto;
}

h1{
  font-size: 28px;
}

h2{
  font-size: 22px;
}

p{
  font-size: 16px;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 30px;
}

td,
th {
  padding: 5px;
  border: none;
  vertical-align: top;
  text-align: left;
}

table#order-summary td{
  border-bottom: 1px solid #ccc;
}

table#customer td{
  width: 50%;
}
</code></pre>

<p>
</p>

<p>
  
    {{"Ordrebekreftelse"|t}}</p>

<pre><code>&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Hei!"t}}&lt;br style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
{{"tusen takk for at du valgte å handle hos Vask&amp;amp;sol!"|t}}&lt;/p&gt;

&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Nedenfor finner du en oppsummering av din ordre. Vennligst kontakt oss umiddelbart dersom noe ikke stemmer."|t}}&lt;/p&gt;

&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Referanse:"|t}} #{{order.id}}&lt;/p&gt;
&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Dato:"|t}} {{order.dateOrdered}}&lt;/p&gt;
&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;{{"Status:"|t}} {{order.orderStatus}}&lt;/p&gt;

&lt;h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;"&gt;{{"Oppsummering"|t}}&lt;/h2&gt;
&lt;table id="order-summary" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;"&gt;
  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Produkt"|t}}&lt;/th&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Pris"|t}}&lt;/th&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Antall"|t}}&lt;/th&gt;
    &lt;th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;"&gt;{{"Totalt"|t}}&lt;/th&gt;
  &lt;/tr&gt;

  {% for item in order.lineItems %}
    &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
      &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{item.description}}
        &lt;!-- SKU: {{item.sku}} --&gt;
      &lt;/td&gt;
      &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;
        {% if item.onSale %}
          &lt;strike style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;{{item.price + formatNOK}} &lt;/strike&gt; {{item.salePrice + formatNOK}} kr
        {% else %}
          {{item.price + formatNOK}} kr
        {% endif %}
      &lt;/td&gt;
      &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{item.qty}}&lt;/td&gt;
      &lt;td class="text-right" style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{item.total + formatNOK}} kr&lt;/td&gt;
    &lt;/tr&gt;
  {% endfor %}

  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="text-transform: none; font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Frakt:"|t}} {% if order.shippingMethod.getName() == "" %}{{"Ikke valgt enda"|t}}{% else %}{{order.shippingMethod.getName()}}{% endif %}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{order.totalShippingCost + formatNOK}} kr&lt;/td&gt;
  &lt;/tr&gt;

  {% if order.totalDiscount != "" %}
  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="text-transform: none; font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Rabatt"|t}}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{order.totalDiscount + formatNOK}} kr&lt;/td&gt;
  &lt;/tr&gt;
  {% endif %}

  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Totalt"|t}}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{order.totalPrice + formatNOK}} kr&lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td colspan="3" style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;{{"Herav MVA (25%)"|t}}&lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;"&gt;
</code></pre>

<p>{% set total_vat = order.totalTaxIncluded %}
{% for adjustment in order.adjustments %}
  {% if adjustment.name == 'Shipping VAT' and adjustment.amount > 0 %}
    {% set total_vat = total_vat + adjustment.amount %}
  {% endif %}
{% endfor %}
{{total_vat + formatNOK}} kr</p>

<pre><code>    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;table id="customer" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;"&gt;
  &lt;tr style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;"&gt;
      &lt;h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;"&gt;{{"Leveringsadresse"|t}}&lt;/h2&gt;
      {% if order.shippingAddress %}
        {% include '_includes/addresses/address' with { address: order.shippingAddress } %}
      {% endif %}
    &lt;/td&gt;
    &lt;td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;"&gt;
      &lt;h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;"&gt;{{"Fakturaadresse"|t}}&lt;/h2&gt;
      {% if order.billingAddress %}
        {% include '_includes/addresses/address' with { address: order.billingAddress } %}
      {% endif %}
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;Vask og sol AS&lt;br style="font-family: 'Helvetica', 'Arial', sans-serif;"&gt;
Org. nr. 987654321&lt;br&gt;
&lt;a href="http://vaskogsol.no" style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;"&gt;vaskogsol.no&lt;/a&gt;
</code></pre>

<p></p>
  

</p>

CC BY-SA 3.0
2017-05-09T03:53:22.973Z
Can I suggest you set up in-browser debugging as per my answer here: https://craftcms.stackexchange.com/questions/14970/order-confirmation-email-in-craft-commerce ....as a first step this will help greatly in working out what is going on.
Jeremy Daalder
<templating><error>
Error rendering email template
# Error rendering email template

(Asked by: username_0 on 2017-05-09)

I am getting this error in the commerce.log:
2017/05/08 23:18:49 [error] [plugin] [Forced] Epostmal analysefeil for epost “Behandles”. Bestilling: “097793b”. Malfeil: “An error occurred when rendering a template.”

I can't seem to find what's making the template error, as my other templates works as normal and I receive these emails (so the email system and templates work when changing status for orders, just this template that does not send out the email).
Any help would be appreciated.
The template is the following code:
{% set order = craft.commerce.orders.number(order.number).first() %}




  
  
  
    * {
      font-family: 'Helvetica', 'Arial', sans-serif;
    }
body {
  margin: 0;
  padding: 0;
  min-width: 100%;
}

#container{
  max-width: 700px;
  margin-top: auto;
  margin-right: auto;
  margin-bottom: auto;
  margin-left: auto;
}

h1{
  font-size: 28px;
}

h2{
  font-size: 22px;
}

p{
  font-size: 16px;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 30px;
}

td,
th {
  padding: 5px;
  border: none;
  vertical-align: top;
  text-align: left;
}

table#order-summary td{
  border-bottom: 1px solid #ccc;
}

table#customer td{
  width: 50%;
}




  
    {{"Ordrebekreftelse"|t}}
{{"Hei!"t}}
{{"tusen takk for at du valgte å handle hos Vask&sol!"|t}}

{{"Nedenfor finner du en oppsummering av din ordre. Vennligst kontakt oss umiddelbart dersom noe ikke stemmer."|t}}

{{"Referanse:"|t}} #{{order.id}}
{{"Dato:"|t}} {{order.dateOrdered}}
{{"Status:"|t}} {{order.orderStatus}}

{{"Oppsummering"|t}}

  
    {{"Produkt"|t}}
    {{"Pris"|t}}
    {{"Antall"|t}}
    {{"Totalt"|t}}
  

  {% for item in order.lineItems %}
    
      {{item.description}}
        
      
      
        {% if item.onSale %}
          {{item.price + formatNOK}}  {{item.salePrice + formatNOK}} kr
        {% else %}
          {{item.price + formatNOK}} kr
        {% endif %}
      
      {{item.qty}}
      {{item.total + formatNOK}} kr
    
  {% endfor %}

  
    {{"Frakt:"|t}} {% if order.shippingMethod.getName() == "" %}{{"Ikke valgt enda"|t}}{% else %}{{order.shippingMethod.getName()}}{% endif %}
    {{order.totalShippingCost + formatNOK}} kr
  

  {% if order.totalDiscount != "" %}
  
    {{"Rabatt"|t}}
    {{order.totalDiscount + formatNOK}} kr
  
  {% endif %}

  
    {{"Totalt"|t}}
    {{order.totalPrice + formatNOK}} kr
  

  
    {{"Herav MVA (25%)"|t}}
    

{% set total_vat = order.totalTaxIncluded %}
{% for adjustment in order.adjustments %}
  {% if adjustment.name == 'Shipping VAT' and adjustment.amount > 0 %}
    {% set total_vat = total_vat + adjustment.amount %}
  {% endif %}
{% endfor %}
{{total_vat + formatNOK}} kr
    
  



  
    
      {{"Leveringsadresse"|t}}
      {% if order.shippingAddress %}
        {% include '_includes/addresses/address' with { address: order.shippingAddress } %}
      {% endif %}
    
    
      {{"Fakturaadresse"|t}}
      {% if order.billingAddress %}
        {% include '_includes/addresses/address' with { address: order.billingAddress } %}
      {% endif %}
    
  


Vask og sol AS
Org. nr. 987654321
vaskogsol.no

**Tags:** templating, error
> **Comments:**
> **username_1**: Can I suggest you set up in-browser debugging as per my answer here: https://craftcms.stackexchange.com/questions/14970/order-confirmation-email-in-craft-commerce ....as a first step this will help greatly in working out what is going on.  

---

## 1 answers

### Answer by username_0 on 2017-05-09. Score: 1 | Accepted answer

I don't know exactly why, but I copied the template from the other status and just changed the text differences, and it worked. There was minor differences as I put them side by side in https://www.diffchecker.com/ , so I assume it was some error in spacing or a missing comma somewhere (it works, so I'm happy), here is the new code that worked:
{% set order = craft.commerce.orders.number(order.number).first() %}




  
  
  
    * {
      font-family: 'Helvetica', 'Arial', sans-serif;
    }
body {
  margin: 0;
  padding: 0;
  min-width: 100%;
}

#container{
  max-width: 700px;
  margin-top: auto;
  margin-right: auto;
  margin-bottom: auto;
  margin-left: auto;
}

h1{
  font-size: 28px;
}

h2{
  font-size: 22px;
}

p{
  font-size: 16px;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 30px;
}

td,
th {
  padding: 5px;
  border: none;
  vertical-align: top;
  text-align: left;
}

table#order-summary td{
  border-bottom: 1px solid #ccc;
}

table#customer td{
  width: 50%;
}




  
    {{"Ordrebekreftelse"|t}}
{{"Hei!"}}
{{"tusen takk for at du valgte å handle hos Vaskogsol!"|t}}

{{"Nedenfor finner du en oppsummering av din ordre. Vennligst kontakt oss umiddelbart dersom noe ikke stemmer."|t}}

{{"Referanse:"|t}} #{{order.id}}
{{"Dato:"|t}} {{order.dateOrdered}}
{{"Status:"|t}} {{order.orderStatus}}

{{"Oppsummering"|t}}

  
    {{"Produkt"|t}}
    {{"Pris"|t}}
    {{"Antall"|t}}
    {{"Totalt"|t}}
  

  {% for item in order.lineItems %}
    
      {{item.description}}
        
      
      
        {% if item.onSale %}
          {{item.price + formatNOK}}  {{item.salePrice + formatNOK}} kr
        {% else %}
          {{item.price + formatNOK}} kr
        {% endif %}
      
      {{item.qty}}
      {{item.total + formatNOK}} kr
    
  {% endfor %}

  
    {{"Frakt:"|t}} {% if order.shippingMethod.getName() == "" %}{{"Ikke valgt enda"|t}}{% else %}{{order.shippingMethod.getName()}}{% endif %}
    {{order.totalShippingCost + formatNOK}} kr
  

  {% if order.totalDiscount != "" %}
  
    {{"Rabatt"|t}}
    {{order.totalDiscount + formatNOK}} kr
  
  {% endif %}

  
    {{"Totalt"|t}}
    {{order.totalPrice + formatNOK}} kr
  

  
    {{"Herav MVA (25%)"|t}}
    

{% set total_vat = order.totalTaxIncluded %}
{% for adjustment in order.adjustments %}
  {% if adjustment.name == 'Shipping VAT' and adjustment.amount > 0 %}
    {% set total_vat = total_vat + adjustment.amount %}
  {% endif %}
{% endfor %}
{{total_vat + formatNOK}} kr
      
  



  
    
      {{"Leveringsadresse"|t}}
      {% if order.shippingAddress %}
        {% include '_includes/addresses/address' with { address: order.shippingAddress } %}
      {% endif %}
    
    
      {{"Fakturaadresse"|t}}
      {% if order.billingAddress %}
        {% include '_includes/addresses/address' with { address: order.billingAddress } %}
      {% endif %}
    
  


Vask og Sol AS
Org. nr. 876543219
vaskogsol.no


---

