0

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:

<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>
6
  • 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.
    – Joorren
    Feb 3 at 20:05
  • @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
    Feb 4 at 16:08
  • Can you edit the question and share the full stack trace leading up to the error?
    – Brad Bell
    Feb 4 at 23:34
  • @BradBell I edited the question
    – hackerman
    Feb 8 at 14:30
  • Is there more to the stack trace? That looks like the first line of it.
    – Brad Bell
    Feb 10 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.