linagora / tmail-backend

GNU Affero General Public License v3.0
36 stars 17 forks source link

[ICS Reply] Internationalization #953

Closed Arsnael closed 5 months ago

Arsnael commented 5 months ago

Refactor the dummy hardcoded templates for CalendarEvent/accept /reject /maybe automated replies and allow having different language supported.

For now only two languages should be supported French (fr) and English(en)

3 templates shall be provided per language (so here 3 x 2 = 6 templates)

Put the default templates per language under a default folder

The folder location should be configurable in TMail to be able to allow usage of customized templates.

The language can be passed into the JMAP call like this:

{
    "using": ["urn:ietf:params:jmap:core", "com:linagora:params:calendar:event"],
    "methodCalls": [
        [ "CalendarEvent/accept", {
            "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
            "blobIds": ["0f9f65ab-dc7b-4146-850f-6e4881093965"],
            "language":"fr"
        }, "c1"]
    ]
}

The default language should be english if missing.

DoD: Integration tests

vttranlina commented 5 months ago

Note: The template file can be eml Example: https://github.com/linagora/tmail-backend/blob/d0bac4adfa40884c702e5bef5b1cf706b0f55bd8/tmail-backend/mailbox/plugin/welcome-listener/src/test/resources/file.eml

Arsnael commented 5 months ago

Should be eml yes :)

Thanks for adding this missing declaration

vttranlina commented 5 months ago

pr: https://github.com/linagora/tmail-backend/pull/970