How to utilize template versions for multiple language support

So it seems I can send different email that is written by different language for each customers(localization) according to the docs, but how can I exactly do that? It says I need to activate and change through API, But I couldn't figure out how to achieve it. or do I need to use substitutions and send message bundles from our backend? Any help would be appreciated!
Technical details:
- sendgrid-nodejs Version: master (latest commit: [13af4a6])
- Node.js Version: 6.12.3
Hey everyone who's contributed to this issue!
We are doing some research with customers to try and understand how we can best solve the problem of localizing/translating emails sent using SendGrid. If you've got some time you can spare we'd love your feedback as we think through how to build this right!
Here's a link to signup for a slot to speak with myself and my team about how you handle translation and localization today: https://calendly.com/travisterwilligar/sendgrid-research?month=2019-09
Thanks so much for your time!
@ben-grid just checked the calendy but the times dont work for me, so ill give a short summary of what would be awesome.
We have an e-commerce system with an sandbox and production account. And when we approve of an tempalte we export and import it to production (this is also something that would be a great feature, having sandbox and production templates with a promotion pipeline)
Anyway... currently we have 2 languages, but the task at hand is to move to 5 languages. Currently we have 11 templates. What we do now is the {{if lang.en}} Hi {{else}} Hallo {{/if}} only this will nog work for 5 languages (20 languages in the near future) so now we are going to create separate templates per language, creating 55 templates instead of 11. (horrible)
What would be great!
Option 1: Add a "version" parameter to the API, and just send version provided to. Now we can at least send a spesific version in a written language (versions could be a translated version of the template, fallback would be the active one)
Option 2 Add localized parameters to a template. This way we can use the template for multiple languages by only translating the parameters. Drawback of this approach is that some sentence constructs dont work for each language, so probably you would like to have more felxibility
**Option 3 The Unicorn with golden tears **
Basically have a translation tab for each module you drop in. So when you insert a module like this
this module would have multiple locales. Basically a clone of the original for a different languages. You need to be able to set the language of the template (setting all modules to a specific languages including subject and preheader) maybe coloring modules red if they are not filled in for that module yet
Just my 2 cents, i would love your feedback on this, if you would like to mail, hit me up at [email protected] id love to provide some insight. Thanks and hope there will be a solution fast. And if not some insight in how its going to be tackeled so that we can prepare,
@reneweteling Thanks much, that's very helpful. We are working on a prototype that's probably going to be more akin to option 2 and 3 than 1. I'll hit you up via email when we have something worth getting feedback on. Thanks again for your input!
@reneweteling I think option 1 or 2 would do the job - since it is very intuitive. Option 3 - well, it is just nice to have...
@ben-grid & @a-tonchev Thanks for all the hard work! ive switched jobs though so for me, this is not relevant any more. Keep up the good work!
Any news on this one? The subject length limitation is a problem for me taking in consideration that I need to localize the subject line also and I think with the new editor the subject length is even smaller, I can have around 110 chars in the subject line.
IMO, It seems that the more workable solution would be to generate all text server side, then just slot it into the template as chunked paragraphs.
If a company is supporting multiple lanugages, then their website will already have a solution to this which should be server side (loading languages from XML/database). In my opinion, any emails related to the same project should also have their text stored in these language files.
The neccessary paragraphs/text can then be pulled from those files depending on the users language, then passed as template variables to sendgrid. Sendgrid would just be an overarching template (like, footer etc - just styles and images) and even some styles would have to be kept in the language file itself - like specifically which words to bold etc.
So the template would end up like: subject HelloLine welcomeparagraph helpparagraph footerslogan. And that's it.
IMO, It seems that the more workable solution would be to generate all text server side, then just slot it into the template as chunked paragraphs.
If a company is supporting multiple lanugages, then their website will already have a solution to this which should be server side (loading languages from XML/database). In my opinion, any emails related to the same project should also have their text stored in these language files.
The neccessary paragraphs/text can then be pulled from those files depending on the users language, then passed as template variables to sendgrid. Sendgrid would just be an overarching template (like, footer etc - just styles and images) and even some styles would have to be kept in the language file itself - like specifically which words to bold etc.
So the template would end up like:
subjectHelloLinewelcomeparagraphhelpparagraphfooterslogan. And that's it.
This is not manageable because you need to redeploy mail service for every copywriting change. Also in some company, mail content is not responsibility of developers but marketing / copywriters. You would need to redeploy another UI to allow editing that, but we pay Sendgrid even for that.
In one project, we use a headless CMS for editing and creating email templates for each language. The server reads these mustache templates at runtime and generates the email body to be sent over to Sendgrid. Sendgrid template editing UX is completely useless so we decided to go with this.
@cecchisandrone I agree sendgrid could be nicer. They need to add in proper language management and just make it a parameter. But like I said, some variables we send to them will need to be localized anyway, like date/time formats for example.
As stated by @corneliu-gavrilovici It's even worth now. In a recent update the length of the subject got even shorter. We are only using 2 languages for now and we were doing it the way below in the subject field:
{{#if english}}
Hello blah blah...
{{else if french}}
Hello blah blah...
{{/if}}
I don't get why this was updated, a product that was usable for us, can't be use anymore due to this matter. You speak in your documentation on how to deal with multiple languages template but it is not properly usable. @ben-grid https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/#multiple-languages
IMO, It seems that the more workable solution would be to generate all text server side, then just slot it into the template as chunked paragraphs. ... The neccessary paragraphs/text can then be pulled from those files depending on the users language, then passed as template variables to sendgrid. Sendgrid would just be an overarching template (like, footer etc - just styles and images) and even some styles would have to be kept in the language file itself - like specifically which words to bold etc.
So the template would end up like:
subjectHelloLinewelcomeparagraphhelpparagraphfooterslogan. And that's it. I have done this in SalesForce using Server-side JS. The json object is in the template but runs on the server during compilation. It is similar to having a real localization feature and it is not dependant on development publishes you'd have in an ecomm environment. I'm looking forward to see what the SG team has come up with as @ben-grid mentions.
+1 localize feature. If we have several languages it's a mess with some many if/else.
Has any work been done to support localization? @ben-grid