Is there a possibility to create template files that can be used for mails that are sent out from nopCommerce?
In my previous projects I used a pair of templates for each message, one html and one plain text (nopCommerce does send Multi-Part mail messages right? If not, why not?).
In a perfect world they could be made dynamically in a built-in editor, but that is probably too much of a hassle. So a really simple function that reads in a template file and replaces the variables would be great. The mails that are being sent out now look... well not so good, especially if branding is important to shop owners. And it should be.
Also there are some really nice responsive email templates out there that could be used as a starting point. Let me know if you need some pointers to (tried and tested) examples.Simplest solution
to begin with should be to choose an external file(s) on template level.
Of course they have to support languages so file input fields should be on the language tab of every template.
This way the shop owner can use any html/txt template they want and implement them gradually. Most of the shop owners really need just few branded templates to begin with, like order confirmation and statuses, account mails etc.I haven't looked at the code that actually creates mails, but i hope it uses MailDefinition Class. There's also a nice article on it over at Martin Normarks blog.Much better solution
would be to check on the fly if there are mail templates in a predefined directory (as a part of the theme of course, great for theme builders too). We just need to define a directory for mail templates (as part of the theme) and a a simple solution based on system template name.
So for example, if there is a file called OrderCompleted.CustomerNotification.sv-SE.html and/or OrderCompleted.CustomerNotification.sv-SE.txt then the system reads in them as a mail body and goes on to replace all variables.
We could also just go with one html file for html body part and use the current solution with the form for the text part.
So anyone else thinks it's a good solution? It's dead easy to implement it anyway... Can be a good idea for the plugin too, but I'd rather see it in the core, everyone needs branded mails.
Thanks for your time, have a great day.