- Issue created by @guido_s
- 🇩🇪Germany guido_s Cologne
Found the cause of the issue now.
Some email bodies where set as ['#type'] = 'processed_text', but had no ['#format'] assigned.
So the plain_text format was used by default which had the filter 'Convert URLs into Links' active with a 'Maximum Link text length' of 72 characters.I fixed this now by creating a new EmailAdjuster and a text format for emails, which will be set if there was no format assigned for processed_text.
Like this:
/** * {@inheritdoc} */ public function build(EmailInterface $email) { $enabled = $this->configuration['enabled'] ?? FALSE; if (!$enabled) { return; } $legacy_message = $email->getParam('legacy_message'); if (isset($legacy_message)) { $bodies = $email->getBody(); foreach ($bodies as &$body) { if (isset($body['#type']) && $body['#type'] === 'processed_text' && !isset($body['#format'])) { // Check if 'html_email' text format exists before using it. if ($this->textFormatExists('html_email')) { $body['#format'] = 'html_email'; } else { // Fall back to a default format if 'html_email' doesn't exist. $body['#format'] = 'plain_text'; } } } $email->setBody($bodies); } }
Automatically closed - issue fixed for 2 weeks with no activity.