By kim.pepper on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
drupal_mail() has moved to the MailManagerInterface::mail() method.
// D7:
drupal_mail($module, $key, $to, $langcode)
// D8:
\Drupal::service('plugin.manager.mail')->mail($module, $key, $to, $langcode);
In addition, some of the mail formatting helper functions were also moved to a helper class.
The drupal_html_to_text() function was moved to a static helper function MailFormatHelper::htmlToText()
// D7:
$text = drupal_html_to_text($string);
// D8:
$text = \Drupal\Core\Mail\MailFormatHelper::htmlToText($string);
drupal_wrap_mail() was moved to a static helper function MailFormatHelper::wrapMail().
// D7:
$text = drupal_wrap_mail($text);
// D8:
$text = Drupal\Core\Mail\MailFormatHelper::wrapMail($text)
Impacts:
Module developers