πŸ‡¨πŸ‡¦Canada @lambic

Account created on 3 May 2006, about 18 years ago
#

Recent comments

πŸ‡¨πŸ‡¦Canada lambic

I got this working by changing the above code to:

       $mail = $this->mailer2->newTypedEmail($module, $key, [
          'id' => $module,
          'send' => TRUE,
          'module' => $module,
          'key' => $key,
          'subject' => $payload->getSubject(),
          'body' => [Markup::create($htmlMessage)],
        ]);
        $to = new Address($to, $toname, $language->getId());
        $from = new Address($from, '"'.$fromname.'"', $language->getId());
        $mail->setTo($to);
        $mail->setFrom($from);
        $mail->setReplyTo($reply);
        $mail->setTextBody($textMessage);
        $result = $mail->send();

but I'm noticing that the from and to headers are in lowercase, I think they're supposed to be 'From' and 'To'?

πŸ‡¨πŸ‡¦Canada lambic

I'm getting this error, but in the build phase not the pre-render phase:

TypeError: Unsupported operand types: null + array in Drupal\symfony_mailer\Plugin\EmailBuilder\LegacyEmailBuilder->build() (line 107 of modules/contrib/symfony_mailer/src/Plugin/EmailBuilder/LegacyEmailBuilder.php)

Here's the code we use to send the email:

      $to = new Address($to, $toname, $language->getId());
      $from = new Address($from, $fromname, $language->getId());
      $htmlMessage = $payload->getMessage();
      $converter = new Html2Text($htmlMessage, ['do_links' => 'table']);
      $textMessage = $converter->getText();
      $result = $this->mailer2->newTypedEmail($module, $key)
        ->setTo($to)
        ->setFrom($from)
        ->setReplyTo($reply)
        ->setBody([
          '#markup' => $htmlMessage,
        ])
        ->setTextBody($textMessage)
        ->setSubject($payload->getSubject())
        ->send();
πŸ‡¨πŸ‡¦Canada lambic

I'm getting this issue too, but only on one of our drupal repos, the other one ugpraded successfully. I'm guessing it's a problem with a contrib module but I don't know which one.

πŸ‡¨πŸ‡¦Canada lambic

I'm seeing the field in my jsonapi output, but it's only showing the first value. My computeValue method returns [1,2] but in the jsonapi I just see "1"

πŸ‡¨πŸ‡¦Canada lambic

I've checked that I'm on the latest version and the attached patch is there, but I'm still having issues with lost style tags.

Here's my EmailBuilder code:

$email->setSubject($payload->getSubject())
      ->setTo($to)
      ->setFrom($from)
      ->setReplyTo($reply)
      ->setBody(['#markup' => $htmlMessage])
      ->setTextBody($textMessage);

I've confirmed that I see the style tags before $email->render() gets called in Mailer.php, but I'm not sure how to track it after that as getBody() fails after that point.

Note also that you can't use devel to debug this because devel also strips out style tags, so I had to do this to debug:

\Drupal::database()->insert('x')->fields(['y' => $email->getBody()['#markup']])->execute();

Production build 0.69.0 2024