1

I am getting this error when trying to send a confirmation email to the user.

Template error: “Variable "option" does not exist

If I remove every bit of markup from my email template, and literally only have <p>Hello World</p> I get an email.

I am able to click the "Download Receipt" link, and everything works great.

When I output the option variable: {{ option }}: When I click on the "Download" link, I see receipt.

I am using the default template that ships with commerce, with the addition of a jpg header image. At the bottom of the template is this:

...
{% endset %}

{# Use the option param passed into the pdf template to show different 
   order pdf's depending on the context #}

 {% switch option %}
 {% case "receipt" %}
    <h1>Receipt for Order #{{ order.number[:7] }}</h1>
    {{ orderTable }}
{% case "ajax" %}
    <h1>NA</h1>
{% default %}
    {{ orderTable }}
{% endswitch %}
</body>

So clearly it has something to do with option not getting set. I'm not sure where I might have un-done setting that variable.

Any suggestions are greatly appreciated!

1 Answer 1

3

The option variable is only available in the pdf template, it is not available in the email template.

order variable available in both.

1
  • Ok it's got to be a variable I've added somewhere else. Thanks Luke! Commented Apr 11, 2017 at 14:35

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.