Skip to content

i18n support in Emails and Messages app #726

Description

@krzysztofwolski

Problem I would like to solve

Send fully translated emails to customers.

Intro

API

Saleor API provides translation models that the App could use. To choose a language, we can:

Currently, the API does not provide a way to automatically detect language and add a proper translation to the subscription. It means additional API calls after receiving the webhook.

Templates

Sendgrid and SMTP providers lack dedicated i18n support and require conditional rendering with Handlebars to localize text. Sendgrid documentation with examples for reference.

For initial i18n implementation in the EAM, it would be recommended approach. As a potential improvement in the future, we could make configuration variants depending on the language:

  • user creates a base configuration, it will be used as a fallback if there's no variant related to the email language
  • user creates a dedicated variant for the language. A variant would provide an interface to choose a different sender, message subject and template.

When a webhook arrives, the App checks for any configuration variant of the event language. If none is found, the base configuration is used.

The proposed solution increases the app's complexity (both for implementation and for the user).

Impact

  • modify webhook subscriptions to add customer/event language code
  • add queries for model translations
  • add translations to template payload
### Tasks
- [ ] https://github.com/saleor/apps/issues/727

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions