getAuthenticatedMockMessage example

$results[] = $result + $default_result;
    $result['key'] = 'page_copy';
    $result['to'] = 'anonymous@drupal.org';
    $results[] = $result + $default_result;
    $result['key'] = 'page_autoreply';
    $result['from'] = NULL;
    $results[] = $result + $default_result;
    $data[] = [$message$sender$results];

    // For authenticated user.     $results = [];
    $message = $this->getAuthenticatedMockMessage();
    $sender = $this->getMockSender(FALSE, 'user@drupal.org');
    $result = [
      'module' => 'contact',
      'key' => 'user_mail',
      'to' => 'user2@drupal.org',
      'langcode' => 'en',
      'params' => [
        'contact_message' => $message,
        'sender' => $sender,
        'recipient' => $message->getPersonalRecipient(),
      ],
      
Home | Imprint | This part of the site doesn't use cookies.