Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle language on registration email #202

Closed
jonas-martinez opened this issue Apr 25, 2022 · 4 comments · Fixed by #219
Closed

Handle language on registration email #202

jonas-martinez opened this issue Apr 25, 2022 · 4 comments · Fixed by #219
Assignees
Labels
enhancement New feature or request

Comments

@jonas-martinez
Copy link
Collaborator

No description provided.

@jonas-martinez jonas-martinez added the enhancement New feature or request label Apr 25, 2022
@jonas-martinez
Copy link
Collaborator Author

SendGrid does not provide a way to manage language on emails.
The only way to do it from their documentation : https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/different-languages
This is not clean at all and can become unmanageable really fast.

Here is an example with only 2 languages (French & English) on the subject of the mail :
image

We can see that it is not easily readable, even less readable if we add dozens of languages

@jonas-martinez
Copy link
Collaborator Author

Another way to do that would be to create different versions of a template, each one corresponding to a language. This makes everything clean but the only way to make it work is to activate/deactivate the version you want to use. This is prone to race conditions on version activation.

@jonas-martinez
Copy link
Collaborator Author

@lenra-io/lenra Should we let the server manage languages or should we use the first solution with SendGrid even though this can become unmanageable ? We could find another mail delivery system in the future that handles language properly.

@shiipou
Copy link
Contributor

shiipou commented Apr 29, 2022

@lenra-io/lenra Should we let the server manage languages or should we use the first solution with SendGrid even though this can become unmanageable ? We could find another mail delivery system in the future that handles language properly.

I think letting server doing it can be better for open-sourcing the project, but idk if that take more time to develop. In that case, take the simplest way.
Probably using multiple template for each language can do the job better than with the if else.
Create a verification_code_template_fr and a verification_code_template_en to manage languages.

@ClementGld ClementGld self-assigned this May 4, 2022
@ClementGld ClementGld linked a pull request May 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants