You are here

protected function QueueMailFunctionalTest::sendQueueMailTest in Queue Mail 8

Wraps send mail function.

Parameters

string $key: A key to identify the email sent.

string $to: The email address or addresses where the message will be sent to.

array $params: (optional) Parameters to build the email.

Return value

array The $message array structure containing all details of the message.

4 calls to QueueMailFunctionalTest::sendQueueMailTest()
QueueMailFunctionalTest::sendEmailAndTest in tests/src/Functional/QueueMailFunctionalTest.php
Send an email and ensure it is queued or sent immediately.
QueueMailFunctionalTest::testCancelMessage in tests/src/Functional/QueueMailFunctionalTest.php
Test that message sending may be canceled.
QueueMailFunctionalTest::testFailMessage in tests/src/Functional/QueueMailFunctionalTest.php
Test that message sending may be failed.
QueueMailFunctionalTest::testSkippedEmail in tests/src/Functional/QueueMailFunctionalTest.php
Test that messages are not queued if the the "send" flag is FALSE.

File

tests/src/Functional/QueueMailFunctionalTest.php, line 216

Class

QueueMailFunctionalTest
Tests queue mail functionality.

Namespace

Drupal\Tests\queue_mail\Functional

Code

protected function sendQueueMailTest($key, $to, array $params = []) {
  return \Drupal::service('plugin.manager.mail')
    ->mail('queue_mail_test', $key, $to, $this->langcode, $params);
}