Caching custom receipt text email template + cart.inc.txt.twig via the API?

pixelchutespixelchutes Member
in Bugs & Feature Requests edited April 2015
There is some discussion going around about the new Apple Watch and how it lacks the ability to render the HTML version of emails, relying on the Plain Text email as a fallback.

This made me take a closer look at any customizations occurring in the HTML version of FC order emails that is otherwise missing from the text version. Hopefully this is more of an edge case -- though I'm sure this could be happening elsewhere, not limited to people's wrists :) -- but nevertheless, the two should still be in sync after any customizations.

That said, I am looking for a way to extend the automation of caching custom twig templates (for plain text email) via the API.

Now that cart_include caching support was recently added, and with existing support for template_type = email, I think this should get me most of the way there. However, I'm not seeing a way to customize cart.inc.txt.twig? Interesting to note that custom text email template does not have a "Template URL" option in FC Admin like the HTML version does?

I believe I can still make everything work, presumably by replacing:
{% include 'cart.inc.txt.twig' %}
with the modified contents of the source cart.inc.txt.twig file, but I still wanted to post my findings here in the event I am missing an (undocumented?) way to caching cart.inc.txt.twig via the API? cart_include_text, etc?
Comments
  • fc_adamfc_adam FoxyCart Team
    @pixelchutes,

    Great question. Currently there isn't a way to handle caching the text version of the cart. How you've detailed it is the way to handle it currently. I'll create a ticket to look into the ability to cache the cart text template.
  • Thanks, Adam. Appreciate the confirmation on the current approach, too. We can definitely work with this.
Sign In or Register to comment.