Account created on 26 July 2021, over 3 years ago
#

Recent comments

🇯🇴Jordan heshamkh

Hello @Marty2081, I faced this problem and I created a patch that should fix it
Thanks :)

🇯🇴Jordan heshamkh

Hello, remaye
if you mean you have the user email but the user not registered yet,
yes you can .. I had a similar issue then I saw this https://www.drupal.org/node/2180227
and this is how I solve this issue

   $owner_email = $entity->field_email->value;
    $message = Message::create(['template' => 'new_user_register_for_user']);
    $message->save();
    // use this options array with the mail key if you want to send it to user who is not yet registered but you have his email
   // for contact us form or similar use case 
    $options =['mail' => $owner_email ];
    // Send a message to email directly.
    $notifier->send($message, $options);
🇯🇴Jordan heshamkh

Hello endless_wander,
i had a similar issue then I saw this https://www.drupal.org/node/2180227
and this is how I solve this issue

   $owner_email = $entity->field_email->value;
    $message = Message::create(['template' => 'new_user_register_for_user']);
    $message->save();
    // use this options array with the mail key if you want to send it to user who is not yet registered but you have his email
   // for contact us form or similar use case 
    $options =['mail' => $owner_email ];
    // Send a message to email directly.
    $notifier->send($message, $options);
Production build 0.71.5 2024