diff --git a/core/lib/Drupal/Core/Mail/MailManagerInterface.php b/core/lib/Drupal/Core/Mail/MailManagerInterface.php index 1ad2e46..41795a3 100644 --- a/core/lib/Drupal/Core/Mail/MailManagerInterface.php +++ b/core/lib/Drupal/Core/Mail/MailManagerInterface.php @@ -48,8 +48,8 @@ * function example_notify($accounts) { * foreach ($accounts as $account) { * $params['account'] = $account; - * // example_mail() will be called based on the first drupal_mail() parameter. - * drupal_mail('example', 'notice', $account->mail, user_preferred_langcode($account), $params); + * // example_mail() will be called based on the first \Drupal::service('plugin.manager.mail')->mail() parameter. + * \Drupal::service('plugin.manager.mail')->mail('example', 'notice', $account->mail, user_preferred_langcode($account), $params); * } * } * @@ -72,13 +72,13 @@ * } * @endcode * - * Another example, which uses drupal_mail() to format a message for sending - * later: + * Another example, which uses \Drupal::service('plugin.manager.mail')->mail() + * to format a message for sending later: * * @code * $params = array('current_conditions' => $data); * $to = 'user@example.com'; - * $message = drupal_mail('example', 'notice', $to, $langcode, $params, FALSE); + * $message = \Drupal::service('plugin.manager.mail')->mail('example', 'notice', $to, $langcode, $params, FALSE); * // Only add to the spool if sending was not canceled. * if ($message['send']) { * example_spool_message($message); @@ -108,10 +108,10 @@ * @param string|null $reply * Optional email address to be used to answer. * @param bool $send - * If TRUE, drupal_mail() will call drupal_mail_system()->mail() to deliver - * the message, and store the result in $message['result']. Modules - * implementing hook_mail_alter() may cancel sending by setting - * $message['send'] to FALSE. + * If TRUE, \Drupal::service('plugin.manager.mail')->mail() will call + * drupal_mail_system()->mail() to deliver the message, and store the result + * in $message['result']. Modules implementing hook_mail_alter() may cancel + * sending by setting $message['send'] to FALSE. * * @return string * The $message array structure containing all details of the