<p>In the logs, I have this error:</p>
<blockquote>
<p>2021-02-01 18:00:04 [-][-][-][error][craft\commerce\services\Emails::sendEmail] Email template parse error for email “Order Submitted”. Order: “123456”. Template error: “An exception has been thrown during the rendering of a template (&quot;Getting unknown property: craft\console\Request::csrfParam&quot;).” /home/project/templates/shop/_includes/order-review.twig:48</p>
</blockquote>
<p>The code that it points to is this:</p>
<pre class="lang-html prettyprint-override"><code>&lt;form method=&quot;post&quot;&gt;
     {{ csrfInput() }}
     {{ actionInput('commerce/cart/update-cart') }}
     {{ redirectInput('/shop/checkout/payment') }}
     &lt;div class=&quot;input-group&quot;&gt;
          &lt;input type=&quot;text&quot;name=&quot;couponCode&quot; value=&quot;{{ cart.couponCode }}&quot; placeholder=&quot;{{ &quot;Coupon Code&quot;|t }}&quot;&gt;
          &lt;div class=&quot;input-group-append&quot;&gt;
               &lt;button type=&quot;submit&quot; class=&quot;btn btn-purple&quot;&gt;Update Cart&lt;/button&gt;
          &lt;/div&gt;
     &lt;/div&gt;
&lt;/form&gt;
</code></pre>

CC BY-SA 4.0
2021-02-03T20:05:04.920Z
Do you have a bit more context on how you request the template?
It seems to be using the console Request, which doesn't have a csrfParam variable.
This variable is only available in the web Request.
Joorren
CC BY-SA 4.0
2021-02-04T16:08:54.660Z
@Joorren This is code for entering a coupon code on a checkout page. When a user enters a code, it updates the order and refreshes the page. There isn't a controller as the routing is done via the file structure of the templates.
hackerman
CC BY-SA 4.0
2021-02-04T23:34:53.983Z
Can you edit the question and share the full stack trace leading up to the error?
Brad Bell
CC BY-SA 4.0
2021-02-08T14:30:30.240Z
@BradBell I edited the question
hackerman
CC BY-SA 4.0
2021-02-10T19:10:40.430Z
Is there more to the stack trace? That looks like the first line of it.
Brad Bell
CC BY-SA 4.0
2021-02-22T15:16:30.483Z
@BradBell There isn't any more in queue.log. Would I be able to find it somewhere else?
hackerman
<templating><emails><csrf><error-templates>
Email template error
# Email template error

(Asked by: username_0 on 2021-02-03)

In the logs, I have this error:

2021-02-01 18:00:04 [-][-][-][error][craft\commerce\services\Emails::sendEmail] Email template parse error for email “Order Submitted”. Order: “123456”. Template error: “An exception has been thrown during the rendering of a template ("Getting unknown property: craft\console\Request::csrfParam").” /home/project/templates/shop/_includes/order-review.twig:48

The code that it points to is this:

     {{ csrfInput() }}
     {{ actionInput('commerce/cart/update-cart') }}
     {{ redirectInput('/shop/checkout/payment') }}
     
          
          
               Update Cart

**Tags:** templating, emails, csrf, error-templates

> **Comments:**
> **username_1**: Do you have a bit more context on how you request the template? It seems to be using the console Request, which doesn't have a csrfParam variable. This variable is only available in the web Request.  
> **username_0**: @username_1 This is code for entering a coupon code on a checkout page. When a user enters a code, it updates the order and refreshes the page. There isn't a controller as the routing is done via the file structure of the templates.  
> **username_2**: Can you edit the question and share the full stack trace leading up to the error?  
> **username_0**: @BradBell I edited the question  
> **username_2**: Is there more to the stack trace? That looks like the first line of it.  
> **username_0**: @BradBell There isn't any more in queue.log. Would I be able to find it somewhere else?  

---

## 0 answers

