Problem/Motivation
When a user signup on the platform from a course (e.g. by requesting to join a course), a destination URL is appended to the one-time-login link sent in the email. It's currently done in \Drupal\social_course\SocialCourseOverrides by overriding the config user.mail and replacing the [user:one-time-login-url] string by [user:one-time-login-url][user:destination-url], which contains the destination URL.
However, since the original config value is being assigned directly to the mail body, the messages are always sent in the original language, even though there is a config translation available.
Proposed resolution
Since overriding a configuration is not always a good idea, given that it makes hard to maintain and debug, the proposed solution is to properly replace the token [user:one-time-login-url] in a hook_mail_alter(), so it will always return the proper content according to the user's language.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork social_course-3438712
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tregismoreira commentedComment #3
tregismoreira commentedComment #4
tregismoreira commentedComment #6
tregismoreira commentedComment #9
ribelFix was tested, merged and released in version 5.2.3