Send translated emails in the same language the commerce module would send

Created on 13 September 2022, over 2 years ago
Updated 17 July 2024, 6 months ago

Problem/Motivation

It would be good if e-mail languages would be determined the same way as Drupal Commerce when it sends the receipt? Based on customer's preferred langcode or for anonymous orders ✨ Save which language was used during checkout Needs review .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia kaszarobert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I have updated patch for latest version 1.0.0 of the module.

  • Small notice. Mine patch is incompatible with this issue: https://www.drupal.org/project/commerce_email/issues/3314082 πŸ› Mail "to" replaceTokens Fixed . Anyway the metioned issue is resolved also.

  • I have updated the patch for the latest dev branch changes. There is the same feature request that is not dependent on the commerce core patch ( https://www.drupal.org/project/commerce_email/issues/3282118 β†’ ). Definitely, there is demand for this feature.

  • Fix the error in patch from previous comment.

  • πŸ‡§πŸ‡ͺBelgium weseze

    I also need this functionality, didn't expect that it would not be standard...

    Attached is a revised patch that works against latest stable release. (8.x-1.5)

    I've added 2 changes:
    1/ passing the langcode also to the the $params array
    2/ reset the active language to what it was after the mail processing; this would prevent any other processes from using the wrong language

    Also fixed som typos in variable names. (but that might be because of changes to dev?)

    I als think this still needs work since the behaviour should be optional/configurable.
    You do not always want to send mails in the customers language. For example when sending mails to administrators, they prefer fixed language.

Production build 0.71.5 2024