Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-09T06:38:57.970Z
Answers.LastActivityDate: 2017-05-09T06:38:57.970Z
Answers.UserDisplayName: Vegard
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-09T03:53:22.973Z
Comments.Text: 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.
Comments.UserDisplayName: Jeremy Daalder
Tags: <templating><error>
Title: Error rendering email template
ThreadText: # 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}}
  
  ```
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Hei!"t}}<br style="font-family: 'Helvetica', 'Arial', sans-serif;">
  {{"tusen takk for at du valgte å handle hos Vask&amp;sol!"|t}}</p>
  
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Nedenfor finner du en oppsummering av din ordre. Vennligst kontakt oss umiddelbart dersom noe ikke stemmer."|t}}</p>
  
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Referanse:"|t}} #{{order.id}}</p>
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Dato:"|t}} {{order.dateOrdered}}</p>
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Status:"|t}} {{order.orderStatus}}</p>
  
  <h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;">{{"Oppsummering"|t}}</h2>
  <table id="order-summary" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;">
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Produkt"|t}}</th>
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Pris"|t}}</th>
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Antall"|t}}</th>
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Totalt"|t}}</th>
    </tr>
  
    {% for item in order.lineItems %}
      <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
        <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{item.description}}
          <!-- SKU: {{item.sku}} -->
        </td>
        <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">
          {% if item.onSale %}
            <strike style="font-family: 'Helvetica', 'Arial', sans-serif;">{{item.price + formatNOK}} </strike> {{item.salePrice + formatNOK}} kr
          {% else %}
            {{item.price + formatNOK}} kr
          {% endif %}
        </td>
        <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{item.qty}}</td>
        <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;">{{item.total + formatNOK}} kr</td>
      </tr>
    {% endfor %}
  
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Frakt:"|t}} {% if order.shippingMethod.getName() == "" %}{{"Ikke valgt enda"|t}}{% else %}{{order.shippingMethod.getName()}}{% endif %}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{order.totalShippingCost + formatNOK}} kr</td>
    </tr>
  
    {% if order.totalDiscount != "" %}
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Rabatt"|t}}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{order.totalDiscount + formatNOK}} kr</td>
    </tr>
    {% endif %}
  
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Totalt"|t}}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{order.totalPrice + formatNOK}} kr</td>
    </tr>
  
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Herav MVA (25%)"|t}}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">
  
  ```
  
  {% 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
  
  ```
      </td>
    </tr>
  </table>
  
  <table id="customer" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;">
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;">
        <h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;">{{"Leveringsadresse"|t}}</h2>
        {% if order.shippingAddress %}
          {% include '_includes/addresses/address' with { address: order.shippingAddress } %}
        {% endif %}
      </td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;">
        <h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;">{{"Fakturaadresse"|t}}</h2>
        {% if order.billingAddress %}
          {% include '_includes/addresses/address' with { address: order.billingAddress } %}
        {% endif %}
      </td>
    </tr>
  </table>
  
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">Vask og sol AS<br style="font-family: 'Helvetica', 'Arial', sans-serif;">
  Org. nr. 987654321<br>
  <a href="http://vaskogsol.no" style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">vaskogsol.no</a>
  
  ```
  
  **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}}
  
  ```
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Hei!"}}<br style="font-family: 'Helvetica', 'Arial', sans-serif;">
  {{"tusen takk for at du valgte å handle hos Vaskogsol!"|t}}</p>
  
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Nedenfor finner du en oppsummering av din ordre. Vennligst kontakt oss umiddelbart dersom noe ikke stemmer."|t}}</p>
  
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Referanse:"|t}} #{{order.id}}</p>
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Dato:"|t}} {{order.dateOrdered}}</p>
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">{{"Status:"|t}} {{order.orderStatus}}</p>
  
  <h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;">{{"Oppsummering"|t}}</h2>
  <table id="order-summary" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;">
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Produkt"|t}}</th>
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Pris"|t}}</th>
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Antall"|t}}</th>
      <th style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;">{{"Totalt"|t}}</th>
    </tr>
  
    {% for item in order.lineItems %}
      <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
        <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{item.description}}
          <!-- SKU: {{item.sku}} -->
        </td>
        <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">
          {% if item.onSale %}
            <strike style="font-family: 'Helvetica', 'Arial', sans-serif;">{{item.price + formatNOK}} </strike> {{item.salePrice + formatNOK}} kr
          {% else %}
            {{item.price + formatNOK}} kr
          {% endif %}
        </td>
        <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{item.qty}}</td>
        <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;">{{item.total + formatNOK}} kr</td>
      </tr>
    {% endfor %}
  
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Frakt:"|t}} {% if order.shippingMethod.getName() == "" %}{{"Ikke valgt enda"|t}}{% else %}{{order.shippingMethod.getName()}}{% endif %}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{order.totalShippingCost + formatNOK}} kr</td>
    </tr>
  
    {% if order.totalDiscount != "" %}
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Rabatt"|t}}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{order.totalDiscount + formatNOK}} kr</td>
    </tr>
    {% endif %}
  
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Totalt"|t}}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">{{order.totalPrice + formatNOK}} kr</td>
    </tr>
  
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <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;">{{"Herav MVA (25%)"|t}}</td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;border-bottom: 1px solid #ccc;">
  
  ```
  
  {% 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
  
  ```
        </td>
    </tr>
  </table>
  
  <table id="customer" style="font-family: 'Helvetica', 'Arial', sans-serif;border-collapse: collapse;border-spacing: 0;width: 100%;margin-bottom: 30px;">
    <tr style="font-family: 'Helvetica', 'Arial', sans-serif;">
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;">
        <h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;">{{"Leveringsadresse"|t}}</h2>
        {% if order.shippingAddress %}
          {% include '_includes/addresses/address' with { address: order.shippingAddress } %}
        {% endif %}
      </td>
      <td style="font-family: 'Helvetica', 'Arial', sans-serif;padding: 5px;border: none;vertical-align: top;text-align: left;width: 50%;">
        <h2 style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 22px;">{{"Fakturaadresse"|t}}</h2>
        {% if order.billingAddress %}
          {% include '_includes/addresses/address' with { address: order.billingAddress } %}
        {% endif %}
      </td>
    </tr>
  </table>
  
  <p style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">Vask og Sol AS<br style="font-family: 'Helvetica', 'Arial', sans-serif;">
  Org. nr. 876543219<br>
  <a href="http://vaskogsol.no" style="font-family: 'Helvetica', 'Arial', sans-serif;font-size: 16px;">vaskogsol.no</a>
  </p>
  
  ```
  
  
  ---
  
  