This is most likely another Stash parse order issue, but I'm not sure.

I'm trying to stay DRY and use Stash inside of Cartthrob notification emails.

I have my templates set up like so:

- emails.group/  
-- low-inventory.html
- stash/  
-- layouts/
--- email.html  

I've set up Cartthrob to use low-inventory.html as the email notification.
I'm intending to use email.html as the wrapper layout/view file.

emails.group/low-inventory.html looks something like this:


{exp:stash:set name="title"}Low Stock Notification{/exp:stash:set}

{exp:stash:set name="content" parse_tags="yes"}
  {exp:channel:entries entry_id="{entry_id}"}
    Product ({title}) has a low inventory ({inventory}).

stash/layouts/email.html looks something like this:

{exp:stash:set name="img_url" type="snippet"}{site_url}images/site/{/exp:stash:set}


The email I receive in my inbox ends up looking like this:


I know something like that means something hasn't been parsed properly.
Although, I'm not sure where I've gone wrong or what to change.
Or, if you know that this isn't possible with Cartthrob notifications, let me know.

Any suggestions would be appreciated. Thanks!

  • To clarify, I only see this in the email. If I view the template in the browser it works perfectly. Commented Jan 2, 2013 at 17:13
  • Also, if I add process="start" to the {stash:embed} tag, I see the wrapper/view, but now the stash set/get tags don't seem to work. (Email and in-browser) Commented Jan 2, 2013 at 17:14

2 Answers 2


You're seeing the placeholder code that should get replaced when the template_post_parse hook is called. I guess CT notification templates don't support that hook.

You could either use an EE embed ( assuming CT supports those) or try to get the embed to be processed later in the parse order but without relying on that hook. That would mean using process="inline" parameter for the stash embed and putting it at the bottom of the host template, rather than the top.

  • Not sure why I seem to be logged in as a new account. Weird. Commented Jan 2, 2013 at 20:38
  • Merged those accounts for you Mark. Commented Jan 3, 2013 at 21:29
  • I made sure all my setters were before my getters and made my embed process inline. Commented Jan 4, 2013 at 14:49

I think it basically comes down to this: you need to set, before you get.

What if you add process="end" to the {stash:embed}? That means that the sets will happen first, and then it will process the embed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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