Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Internationalization of emails has been introduced in Hydrophone through the use of static HTML files that contain placeholders for localized content to be filled at runtime.
This content is based on the audience language. The audience language follows a logic based on Tidepool user language, browser language and English as a default.
As a matter of fact, the previous logic of having in-code templates (ie in .go files) for emails has been moved to a logic of having templates generated from static files residing on the file system. A potential evolution can be to have files hosted on a S3 bucket (after pitfall described below is solved).
Pitfall
Following the previous logic of having all the templates in memory when the API service is starting, this first version of emails based on HTML templates has the same pitfall: it needs a service restart to take changes in the HTML files into consideration.
Details
For more details, please check docs/README