Custom E-mail template based on culture being used
Hii..
Is it possible to use custom E-mail template based on culture for order confirmation E-mail?
Right now I'm getting the template referred in "Common"
As it's not possible to use Dictionary values in E-mail template i need to create separate email body for en-US, da-DK etc
I tried replicating the existing template and alter it and referred in each culture appropriately but doesn't work.!
How can i solve this.?
Thanks
The way this is built to work is that you should create a template file per culture, then within the email template config, for each culture select the relevant template file
Sorry I don't seem to be able to upload a screenshot atm, but if you go into an email template you should see tabs across the top for the different cultures then on each tab you can select a different email template file. By setting these on each culture, TC should use the one most relevant to the current Request.
Hi Matt
I have created separate email confirmation template and assigned it to each culture appropriately in email config but still, the common email template is invoked
Hmm, have you set the LanguageID on the order accordingly? It's this that it uses to know which language to use so you'll need to make sure it's set to the language you wish to send.
Thanks for the suggestion Arun, I'll see what I can do to get this added in.
I haven't tried this, but if you point all your templates to the same file, or only define one template for everything, I wonder if you could set the template renderers culture from the top of your template file, something like...
@{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(order.LanguageId);
}
Custom E-mail template based on culture being used
Hii.. Is it possible to use custom E-mail template based on culture for order confirmation E-mail? Right now I'm getting the template referred in "Common" As it's not possible to use Dictionary values in E-mail template i need to create separate email body for en-US, da-DK etc I tried replicating the existing template and alter it and referred in each culture appropriately but doesn't work.! How can i solve this.? Thanks
Hi Arun,
The way this is built to work is that you should create a template file per culture, then within the email template config, for each culture select the relevant template file
Sorry I don't seem to be able to upload a screenshot atm, but if you go into an email template you should see tabs across the top for the different cultures then on each tab you can select a different email template file. By setting these on each culture, TC should use the one most relevant to the current Request.
Hope this helps
Matt
Hi Matt I have created separate email confirmation template and assigned it to each culture appropriately in email config but still, the common email template is invoked
Arun
Hi Arun,
Hmm, have you set the
LanguageID
on the order accordingly? It's this that it uses to know which language to use so you'll need to make sure it's set to the language you wish to send.Matt
Thank you Matt : )
That works.!!
But it would be very helpful if we have an option to use Umbraco Dictionary.
The project that I'm handling uses multiple cultures, So its very difficult to create and translate separate template for each culture.
Arun
Thanks for the suggestion Arun, I'll see what I can do to get this added in.
I haven't tried this, but if you point all your templates to the same file, or only define one template for everything, I wonder if you could set the template renderers culture from the top of your template file, something like...
Not ideal, but could be worth a try.
Matt
I will try Matt : )
What i planning is to set a single template page and the fields in that template should be translated automatically based on the culture being used.
~Arun
is working on a reply...