Closed (fixed)
Project:
Mailer Plus (DSM+)
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2022 at 17:26 UTC
Updated:
8 Jun 2022 at 10:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adamps commentedComment #4
adamps commentedComment #6
lamp5Ok that is clear for a new implementations, but how to apply language when mails are sending using default drupal service?
$mailManager->mail($module, $key, $to, $langcode, $params, $reply, $send);It does not work right now.
Comment #7
adamps commented@lamp5 Your question should be a separate issue please.
The way it should work is that LegacyEmailBuilder calls $this->mailManager->emailFromArray which calls $email->setAddress with a langcode.
However it has probably just been broken by #3280322: LegacyEmailBuilder calls hook_mail() too early because
setTo()is only valid in the build phase. I reopened that issue. This commit is more recent than your comment so it's probably not the cause of your problem.Comment #8
adamps commented@lamp5 I guess that the correct fix for #3280322: LegacyEmailBuilder calls hook_mail() too early will solve your problem. hook_mail() is called to early, so before the correct language has been set.
Comment #9
seanbHow is this supposed to work if you want to use the language of a node when sending an email? I could understand using the account language as a default, but I guess you should be able to override that right? Is it possible to add
setLangcode()back?