Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-03T20:05:04.920Z
Comments.Text: 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.
Comments.UserDisplayName: Joorren
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-04T16:08:54.660Z
Comments.Text: @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.
Comments.UserDisplayName: hackerman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-04T23:34:53.983Z
Comments.Text: Can you edit the question and share the full stack trace leading up to the error?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-08T14:30:30.240Z
Comments.Text: @BradBell I edited the question
Comments.UserDisplayName: hackerman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-10T19:10:40.430Z
Comments.Text: Is there more to the stack trace? That looks like the first line of it.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-22T15:16:30.483Z
Comments.Text: @BradBell There isn't any more in queue.log. Would I be able to find it somewhere else?
Comments.UserDisplayName: hackerman
Tags: <templating><emails><csrf><error-templates>
Title: Email template error
ThreadText: # 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:
  
  ```html
  <form method="post">
       {{ csrfInput() }}
       {{ actionInput('commerce/cart/update-cart') }}
       {{ redirectInput('/shop/checkout/payment') }}
       <div class="input-group">
            <input type="text"name="couponCode" value="{{ cart.couponCode }}" placeholder="{{ "Coupon Code"|t }}">
            <div class="input-group-append">
                 <button type="submit" class="btn btn-purple">Update Cart</button>
            </div>
       </div>
  </form>
  
  ```
  
  **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**: @username_2 I edited the question  
  > **username_2**: Is there more to the stack trace? That looks like the first line of it.  
  > **username_0**: @username_2 There isn't any more in queue.log. Would I be able to find it somewhere else?  
  
  ---
  
  ## 0 answers
  
  