I have a customer that wants to modify the order confirmation email. I set up a new Entry for order confirmation to include a content block that goes to the email/email_confirmation file.

When I check in the browser or preview it works perfectly. When I actually send the email it doesn’t appear.

1) It works in the browser with:

{% if entry.basicContentBlocks %}
// html code
{% endif %}

2) The Commerce plugin only seems to read from information in Commerce. I tried to pull in the data:

{% set emailEntry = craft.entries.section('emailConfirmation') %}

3) I tried making a global variable that used the email confirmation entry:

{% set emailBlock = craft.globals.getSetByHandle('emailBlock') %}

It seems the email is loaded and sent before the entry information.

Is there a work around to allow customers to add information or pictures from the CMS?

Thank you for your help,

  • You can definitely load entries in a commerce email. Not really sure what errors you are getting? Mar 23 '18 at 19:48

Even though the emailConfirmation was only one entry it was an array.

{% set emailEntry = craft.entries.section('emailConfirmation').first() %}

setting up the entry to the html was similar to what I thought, but I didn't include the ".first()" so I wasn't getting what I expected.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.