使用自定义模板覆盖默认 Satchmo 电子邮件
我正在使用 Satchmo 作为网站的商店部分。我正在尝试用我自己的电子邮件覆盖默认的“order_complete”电子邮件,但到目前为止还无法做到。 docs 表明它应该以与覆盖任何其他模板相同的方式完成。因此,我在 shop/email/order_complete.html 的模板文件夹中创建了一个,但它没有被选取。有人有什么想法吗?
I'm using Satchmo for the shop section of a website. I'm trying to override the default 'order_complete' email with my own, but haven't been able to so far. The docs indicate that it should be done in the same way as overriding any other template. So I've created one in my template folder at shop/email/order_complete.html, but it isn't being picked up. Anyone have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是猜测,Satchmo 是否在安装的应用程序中列在您自己的应用程序之前? (如果是这样,则 order_complete 模板可能会在到达您的模板之前进行匹配。)
尝试将您的应用程序移至 Satchmo 之前,看看是否可以解决问题。
Just a guess but, is Satchmo listed in installed_apps before your own app? (If so the order_complete template may be being matched before yours is ever reached.)
Try moving your app before Satchmo and see if that solves it.
如果您希望模板文件夹优先于应用模板文件夹,则必须在
app_directories
加载器之前设置'django.template.loaders.filesystem.load_template_source',
。If you want your template folder to take precedence over the app template folders, you have to set your
'django.template.loaders.filesystem.load_template_source',
before theapp_directories
loader.