Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arun 29 posts 99 karma points
    16 days ago
    Arun
    0

    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

  • Matt Brailsford 2311 posts 11221 karma points MVP 6x c-trib
    1 week ago
    Matt Brailsford
    0

    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

  • Arun 29 posts 99 karma points
    1 week ago
    Arun
    0

    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

  • Matt Brailsford 2311 posts 11221 karma points MVP 6x c-trib
    1 week ago
    Matt Brailsford
    1

    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

  • Arun 29 posts 99 karma points
    1 week ago
    Arun
    0

    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

  • Matt Brailsford 2311 posts 11221 karma points MVP 6x c-trib
    1 week ago
    Matt Brailsford
    0

    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);
    }
    

    Not ideal, but could be worth a try.

    Matt

  • Arun 29 posts 99 karma points
    1 week ago
    Arun
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft